I have a Telerik MVC Tabstrip.
I have used:
.LoadContentFrom("Grid", "Orders");
"Grid" Action just returns view without model. Then the Ajax request should have been fired to get the data.
It is loading the grid normally but it is not calling the Ajax request to fill the data.
If I am calling the same action normally i.e. without ajax it displays grid and fires Ajax request to load the data.
Perhaps you've missed to register the required JavaScript files for the Grid. You can check the following help topics:
Loading components in tab content
Required JavaScript files
Check the sample available at here.
This one uses MVC 1.0 but can be surely converted to MVC 2.0
Related
I know two ways of submitting form data: by having a button of type submit or by an AJAX post call. What is the difference between those two regarding performace?
This is a very general question, so here is a very general answer.
If you implement the AJAX call efficiently on the server, then you can expect AJAX to be more performant (when measured on the server) than a full page round-trip.
For instance, if you use ASP.NET, clicking a button to submit a page will cause a POST of the form data and a complete re-buildup and rendering of the page. That is not necessary with an AJAX call, if you use real AJAX and not the Microsoft AJAX Control Toolkit for ASP.NET.
Better to use Ajax.BeginForm instead of Html.BeginForm. It will prevent the full postback and will improve the performance.
Ajax POST
Ajax post prevents reload and postback.İt sends data to controller.
Form Data
İt occurs reload page and postback.İt sends data to controller.
I have created an MVC application that uses webgrids to display data on my views. In my grid's toolbar I have drop downs, text boxes and a search button that call Jquery to perform various actions. For example, if I click the search button, I refresh the grid via Ajax based on a text entry. This all works well until interaction with the webgrid (page or sort) occurs. We noticed that if any ajax calls are made, then the sorting and paging do not work anymore. Also, if I load the page and page or sort first, then none of my JavaScript works. I have been researching this issue, but have not seen any concrete solutions. Does anyone have recommendations for a solution?
I would wager to guess that you are attaching your jquery handlers in the document.ready function using something like $("#Sort").click(function(){});. When you reload the grid via an AJAX call, the jquery handlers are not reattached since the DOM was not reloaded. Try using something like this $("#Sort").live('click', function(){}); which will attach the handler to any instance of your identifier once it is present on the page.
This is was a complete guess since you posted no code, but this and the post you referenced above (SO post) seems to have fixed your issue.
I am an average newbie to CakePHP. While reading cookbook found Ajax form and its submission. But it lacks more details.
What are the main difference between ajax form and a normal form or What are the more specific cases we need to use Ajax form over normal form?
An example will be appreciated
Thanks....
A properly implemented Ajax form is exactly the same as a regular form, except that if JavaScript is enabled a submit handler will be bound to it that will prevent the normal submission of the form and send the data using the XMLHttpRequest object. The response will then be processed by JavaScript in the current page instead of by loading an entirely new page.
This isn't necessarily a CakePHP question, it's understanding what AJAX is.
AJAX in layman's terms is basically submitting data to a website without reloading the current page. If this is the sort of feature you want, you'll need to look into the RequestHandler component and the JsHelper in the CakePHP book for the version you are using.
I'm using microsoft ajax and ajax.beginform.
It's working great for model binding my partial view, but I need to conditionally disable some of the buttons in my form itself depending on what comes back from the server.
How can I go about this without using JQuery?
Have you thought instead about using two separate views instead, and have your conditional logic in your controller determine which view to display.
How do I start validation from the client/javascript using the MS MVC Validation library?
Using MS ASP.Net MVC, I have a page with a PartialView in a modal dialog (change password). When the user selects 'save', I need to validate this on the client side without a full page postback. I am able in JS to post and refresh the partialView, however I am unable to start client validation. The MS MVC validation starts on postback (Input type='submit'). How can I start this in JS?
Validation on the full page with postback works. Thanks,
d
I originally posted a link to ASP.NET MVC 2 Custom Validation but I realized that I missed part of the question... It does appear that a few insights are present in the post titled Combining JQuery Form Validation and Ajax Submission with ASP.NET.