Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ajax with Asp.Net MVC?

I need to use few of the ajax control toolkit in asp.net mvc say, Validator CallOut,ModalPopUp.

and even i need to put a gridview in an update panel? can anybody give any valuable link so that i can look into it?

like image 520
nimi Avatar asked Oct 21 '09 10:10

nimi


People also ask

What is Ajax in ASP NET MVC?

As you might be knowing, Ajax is a shorthand for Asynchronous JavaScript and XML. The MVC Framework contains built-in support for unobtrusive Ajax. You can use the helper methods to define your Ajax features without adding a code throughout all the views. This feature in MVC is based on the jQuery features.

How does AJAX work in asp net?

AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.


4 Answers

If you want to have AJAX functionality with ASP.NET MVC I suggest you do that with JQuery (the Javascript framework officially supported by Microsoft and shipping with VS 2010). UpdatePanel was supported in ASP.NET, it is not in ASP.NET MVC.

See a tutorial on how to build some AJAX functionality with ASP.NET MVC here and here.

like image 75
Gergely Orosz Avatar answered Sep 23 '22 17:09

Gergely Orosz


I don't think you'd want to put an update panel and a gridview in an asp.net mvc application.

I don't know what you're trying to do, or why you picked asp.net mvc, but it sounds like you just need to stick to asp.net if you want to do those kind of things. MVC works very differently than classic webforms.

like image 42
Morph Avatar answered Sep 25 '22 17:09

Morph


Also keep in mind that the AJAX framework that Microsoft bolted on to ASP.Net webforms requires a full viewstate postback, so that kills one of the benefits of the MVC framework, which is to not require viewstate for control persistence.

like image 29
Jason Avatar answered Sep 25 '22 17:09

Jason


ASP.Net MVC has no concept of controls, the standard Web Form controls do not work with MVC.

Why are you trying to integrate WebForm controls in MVC?

like image 25
Burt Avatar answered Sep 26 '22 17:09

Burt