Search Results

Search found 6941 results on 278 pages for 'drupal views'.

Page 72/278 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • How to handle model state errors in ajax-invoked controller action that returns a PartialView

    - by Robert Koritnik
    I have a POST controller action that returns a partial view. Everything seems really easy. but. I load it using $.ajax(), setting type as html. But when my model validation fails I thought I should just throw an error with model state errors. But my reply always returns 500 Server error. How can I report back model state errors without returning Json with whatever result. I would still like to return partial view that I can directly append to some HTML element. Edit I would also like to avoid returning error partial view. This would look like a success on the client. Having the client parse the result to see whether it's an actual success is prone to errors. Designers may change the partial view output and this alone would break the functionality. So I want to throw an exception, but with the correct error message returned to the ajax client.

    Read the article

  • MVC Partial View Postback - Jquery validation lost

    - by user415394
    I have a partial view which uses Jquery Valiation. This works OK when initially loaded, however after I do a ajax postback and return the partial view from the server with an error showing, the jquery validation seems to be lost. In that, if I delete a required field and hit save the partial view gets submitted, when I would expect it to show an error message and not get submitted. Does Jquery validation need to be initialised somehow for the form in the partial view?

    Read the article

  • mysql select column from view problem

    - by haim evgi
    i create a view table like : CREATE VIEW ViewManager AS SELECT us.UserId AS 'Account Manager', ......... after that, when i run a query to select data from this view like : SELECT 'Account Manager' , .. from ViewManager then the data i get in this column is the text 'Account Manager' and not the value of the this columns. Is there a way to solve this ? Of course I can change the field name , but i want to know if there is another solution, thanks.

    Read the article

  • ASP.net MVC 2 SPARK - Create "Add New Item" link in spark page.

    - by KarlBear
    I have a web form in SPARK which allow the editing of a Facility class that contains Rooms. When editing the Facility all the Rooms are listed for editing too. The form works fine for editing, but I would like to include a button "Add Room" that adds a new blank room below the existing ones. Any idea how this is accomplished? Currently I am doing this in my SPARK page: [All the Facility editing stuff...] <p>Room</p> <div class="small">Enter the rooms associated with this facility.</div> <div class="add"> <div id="room"> <AddFacilityRoom each="var roomModel in Model.FacilityRooms" RoomModel="roomModel" Index="roomModelIndex" /> </div> <a id="addRoom" class="add" href="events/room/add.mvc">Add a room</a> </div> AddFacilityRoom contains the html elements for editing a room. I would like add.mvc to create a new empty Room class and inject a new identical (but empty) control below the existing ones. Currently, though it opens a new page when the "Add a Room" button is clicked.

    Read the article

  • CSS: Possible to define styles mid way through an html document?

    - by Dr. Zim
    In ASP.NET MVC, there are these snippets of html called view templates which appear when their matching data appears on the screen. For example, if you have a customer order and it has a vendor address, the vendor address view template shows up populated with data. Unfortunately, these don't have access to "MasterPages" nor are aware of their CSS surroundings. Instead of loading these up with style tags, is there any way to create partial CSS files that could work for that particular html snippet, a sort of in-line CSS style section? It would be really nice to plop this down just before we render the partial view: <style type="text/css"> input { margin: .2em .2em; overflow: hidden; width: 18.8em; height: 1.6em; border: 1px solid black;} </style> to have the 15 or so input fields in that particular Html snippet be formatted the same. These are swapped out, so the positions of the input fields change. This may also imply a CSS reset on each partial view.

    Read the article

  • Partial view postback from a standard Html form with MVC

    - by fearofawhackplanet
    I have a file upload button on my MVC view. After the file is uploaded, my FileList partial view on the page should refresh. I tried to upload with Ajax.BeginForm(), but have discovered that Ajax will not submit file data. I've got the file upload working now by using the jQuery Form plugin, which lets you ajaxify the normal Html.BeginForm() submit method. Is is still possible to trigger the partial page update using this method?

    Read the article

  • How do I attach a link (to a View) to an image in ASP.NET MVC?

    - by Ryan Pitts
    Ok, so here is my situation. I am creating a web application using ASP.NET MVC 2 using the C# language. I have programmed in HTML, CSS, and PHP for several years and I am very new to ASP.NET. The part that I am having trouble with is the image gallery. The setup: I have a link on the navigation bar that goes to a "Galleries" page. This page will show a list of galleries. Each gallery has a title, an image, and a description. All of this information is pulled from an XML file. I'm using the XML file like a database. I wanted to use this method so that i could easily update the list of galleries and have the updated XML file automatically be reflected by the website. Now, the galleries should link to an "Images" page. This page will display a list of images within the gallery based on what gallery was selected. This page will also pull from an XML file. The problem: I cannot seem to attach a dynamic link to the image? I am also stuck and not sure how to get the correct View to display. I know I need to do something with the controllers and models, right? I have some code if needed? I would greatly appreciate any help or direction for this! Thanks!

    Read the article

  • Obtain the pathName dinamically for ASP.NET MVC

    - by vikitor
    Hello, I'm looking for a solution that allows me to get the parent page pathname from a partialView invoked. For example I have an Action baa and a controller boo so the javascript to obtain this will be window.location.pathname, and it returns /boo/baa. The thing is that I use a partial view, so when I try to retrieve the pathname via the URL helper, what I obtain is the PartialView one, and what I need is the pathname for the action that invokes it. I want to do this because I want to show certain things of the partial view depending on the pathname of the parent view that invokes it. Is there a way to do this with ASP.NET MVC? Thank you all in advance,

    Read the article

  • backbone model validation error

    - by koko
    I got a validation based on backbone fundamentals by addyosmani, but when i try it on my view i can't get the error that the model generated.TIA model.js validate: function(attrs) { var errors = this.errors = {}; if (!attrs.box) errors.box= 'box value is required'; //console.log(errors.box); if (!_.isEmpty(errors)) return errors; } view.js validate: function(model) { console.log("error text--" + model.errors[this.input] || ''); },

    Read the article

  • Show extra info for Preference screens when CheckboxPreference summary field is not enough long?

    - by Pentium10
    I have situation when you can enabled/disable modules for my Android application. For this I use a CheckboxPreference screen. This is all good, but the summary field gets cut off if longer descriptions are added than 2 lines. Suppose I have 4-5 lines of description available for each module, I would like to display this in a helper window. I tried to bind a click event to the CheckboxPreference, but that fires for the whole line, so not only when the checkbox is clicked, and more, where ever you click on the line the checkbox is toggled. So now I am wondering if this can be fixed. So if the user needs more info, just taps the text and the helper opens up, and if want to toggle the settings it taps the checkbox. How would you do it? I am open to other ideas too, if they do work.

    Read the article

  • How to return number of rows in the template

    - by xRobot
    In my view I return all posts of one blog: posts = Post.objects.filter(blog=blog) and pass it to context. But.. How can I get the number of posts in the template ? This is my template: <h1>Number of posts: {{ ??? }} </h1> {% for post in posts %} {{ post.title }} {{ post.body }} {% endfor %}

    Read the article

  • Rails - how do you create a user index page like stack overflows with multiple tabs whilst keeping t

    - by adam
    On stackoverflow in the users profile area there are many tabs which all display differing information such as questions asked and graphs. Its the same view though and im wondering hows its best to achieve this in rails whilst keeping the controller skinny and logic in the view to a minimum. def index @user = current_user case params[:tab_selected] when "questions" @data = @user.questions when "answers" @sentences = @user.answers else @sentences = @user.questions end respond_to do |format| format.html # index.html.erb nd end but how do i process this in the index view without a load of if and else statments. And if questions and answers are presented differently whats the best way to go about this.

    Read the article

  • Reading int from a hidden field in .aspx

    - by vikp
    Hi, I'm struggling to read an int from the hidden field on aspx page. <input type = "hidden" id = "myIntegerId" name = "integerId" value= "<%: Model.MyObjectId %>" runat = "server" /> The value is definately on the form, I can see it in the debugger and print it with <%: % When I read the form values in the controller, instead of an int I recieve a following string: <%: Model.MyObjectId % I have tried casting data in the hidden field to string and calling ToString() method on that field, neither has worked. The data is submitted using the post event. I have a feeling that I'm missing something very basic... Any help is greately appreciated. Thanks

    Read the article

  • Djangoo Foreign key queries

    - by Hulk
    In the following model: class header(models.Model): title = models.CharField(max_length = 255) created_by = models.CharField(max_length = 255) def __unicode__(self): return self.id() class criteria(models.Model): details = models.CharField(max_length = 255) headerid = models.ForeignKey(header) def __unicode__(self): return self.id() class options(models.Model): opt_details = models.CharField(max_length = 255) headerid = models.ForeignKey(header) def __unicode__(self): return self.id() If there is a row in the database for table header as Id=1, title=value-mart , createdby=CEO How do i query criteria and options tables to get all the values related to header table id=1 Also can some one please suggest a good link for queries examples, Thanks..

    Read the article

  • ASP.NET MVC - Combine Json result with ViewResult

    - by elado
    Can I return a Json result that contains also a rendered view? I need it to return the new ID of a submitted form along with its HTML and some other properties. Also that can be helpful when I need to return two (or more) view results from one action inside a Json object. Thanks!

    Read the article

  • Is it ok to hardcode dynamic links in a permanent view?

    - by meder
    Let's say I wanted to showcase 2-3 clickable buttons on my homepage which will be there permanently. These are links to the css, html, and javascript tag listing pages. Is it fine to just hardcode href=/tags/css and href=/tags/html right in my django templates/view? I won't change them for at least a year or so, meaning I don't think I need to add a column to the tags table to distinguish them - is this common or should I try to make it somewhat dynamic? These tags are in a table but so are 1000 other tags.

    Read the article

  • page.insert_html not rendering partial correctly

    - by mathee
    The following is in the text_field. = f.text_field :title, :size => 50, :onchange => remote_function(:update => :suggestions, :url => {:action => :display_question_search_results}) The following is in display_questions_search_results.rjs. page.insert_html :bottom, 'suggestions', :partial => 'suggestions' Whenever the user types, I'd like to search the database for any tuples that match the keywords in the text field. Then, display those results. But, at the moment, _suggestions.haml only contains the word "suggestions!!". But, instead of seeing "suggestions!!" in the suggestions div tag, I get: try { Element.insert("suggestions", { bottom: "suggestions!!" }); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.insert(\"suggestions\", { bottom: \"suggestions!!\" });'); throw e } I've been trying to find out why this is being done, but the previously asked questions I found seem more complicated than what I'm doing...

    Read the article

  • In Spring MVC (2.0) how can you easily hook multiple pages/urls to use 1 controller?

    - by danny
    <!--dispatcher file--> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/foo/bar/baz/boz_a.html">bozController</prop> </props> </property> </bean> <!--mappings file--> <bean id="bozController" class="com.mycompany.foo.bar.baz.BozController"> <property name="viewPathA" value="foo/bar/baz/boz_a" /> <property name="viewPathB" value="foo/bar/baz/boz_b" /> ... <property name="viewPathZ" value="foo/bar/baz/boz_z" /> </bean> how do I set it up so that when the user loads page boz_w.html it uses the bozController, and sets the viewPath to use boz_w.jsp?

    Read the article

  • SharePoint Error - Datasheet View refuses to show up!

    - by Marius
    Hi, Recently the DataSheet view of my list refuses to dispaly. I tried numerouse times and with no luck. Other lists works just fine, except for this one. there is a Java error message on the left bottom corner of the screen that disapears in 2 seconds, then it renders the list in Standard view any time you try it. I even created a new Datasheet View - the result a Standard View. Any suggestions? Thanks,

    Read the article

  • Is it bad to use a model directly from a view in codeigniter?

    - by jason
    I know normally the data is passed thru to the view with the controller. however, currently in my view I load my model ($this-load-model('Db_model');) so i can use it in a loop to retrieve a users profile picture path from a array of IDs that is passed from controller. Will loading the db model in the view to accomplish this make my site more vulnerable or bad form? To me it seems to be outside of MVC concept but its working atm. thanks

    Read the article

  • Select return dynamic columns

    - by Ascalonian
    I have two tables: Standards and Service Offerings. A Standard can have multiple Service Offerings. Each Standard can have a different number of Service Offerings associated to it. What I need to be able to do is write a view that will return some common data and then list the service offerings on one line. For example: Standard Id | Description | SO #1 | SO #2 | SO #3 | ... | SO #21 | SO Count 1 | One | A | B | C | ... | G | 21 2 | Two | A | | | ... | | 1 3 | Three | B | D | E | ... | | 3 I have no idea how to write this. The number of SO columns is set to a specific number (21 in this case), so we cannot exceed past that. Any ideas on how to approach this? A place I started is below. It just returned multiple rows for each Service Offering, when they need to be on one row. SELECT * FROM SERVICE_OFFERINGS WHERE STANDARD_KEY IN (SELECT STANDARD_KEY FROM STANDARDS)

    Read the article

  • Passing ViewData to PartialView returned from using Html.Action

    - by RWGodfrey
    I want to embed a partial view in an ASP.NET MVC page by returning it from an action method. In my base view, I would have: <%= Html.Action("MyPartialViewAction") %> My controller would have an action method like: [ChildActionOnly] public ActionResult MyPartialViewAction() { return PartialView("MyPartialView"); } I expected the returned partial view (MyPartialView) to have access to the ViewData that was set in the base page's controller action but that doesn't appear to be the case. If I insert the partial view by using the following in my base view it works: <% Html.RenderPartial("MyPartialView") %> I don't want to do that though because I want my "MyPartialViewAction" to execute logic to determine WHICH partial view to return.

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >