views:

105

answers:

5

As far i learned ....AJAX is used for partial page refresh (overcoming the flickering effect in the web page) ....Is there any other features in AJAX....

+2  A: 

Your question is a bit confusing, but you can do Ajax with ASP.NET. You can do partial page refreshes with Ajax among other things using the UpdatePanel in ASP.NET. You may also want to look at jQuery for a simpler more lightweight Ajax solution.

Craig
+2  A: 

Technically Yes. Ajax is used for "partial page" refresh there by eliminating the complete page refresh. There are 2 main advantages

  1. Data transfer : Data transfer (To and from the server) is less compared to the entire page refresh
  2. Better User experience : Since the user will not be seeing a blank page it gives the user an illusion of interacting with the site.

What can be done using AJAX is an ever ending list.

Ex: Gmail uses AJAX for it email. If you are using gmail and compare it with other email providers you will know the difference.

Facebook has rich AJAX features in its site.

SO uses AJAX for comments

I think What AJAX cannot do will be easier to mention. For example

AFAIK web browsers cannot maintain the view state of the AJAX enabled website.

Some AJAX enabled websites do not render properly in mobile browsers.

Anythign more?

Shoban
You are just listing advantages and examples of partial page refresh. See my answer for example of AJAX not related to updating the page, just calling a server-side method from javascript: http://stackoverflow.com/questions/696751/ajaxasp-net/3666465#3666465
awe
+2  A: 

I think you're very mistaken. If AJAX had been created only to solve the problem of partial page refresh/page flickering, it would not have revolutionized the web in the way it has.

The single biggest advantage offerred by AJAX is Client-to-Server Communication that is initiated based on some action on the client. This instantly gives us the ability to make the web much more responsive and user friendly without users having to wait for page reloads and postbacks.

I would suggest that you spend some time researching the subject. Read up on the Wiki article on AJAX.

As far as ASP.NET is concerned, AJAX integrates very well into it. Mature AJAX frameworks such as ASP.NET AJAX and Anthem.NET obfuscate much of the internal details of the XmlHttpRequest.

AmitK
+2  A: 

Ajax has let me add some great new features to my web applications with the free Ajax toolkit. See the link

Ajax Examples

They do not come with out their issues but once you learn how to use them they can really add to the the users experience in you site.

Paul
A: 

ASP.NET uses as you know UpdatePanel for partial page refresh using AJAX.

A less known feature is something .NET calls web methods. This is really AJAX calls that is not connected to the GUI part of the page. You can declare (server-side) a method as a WebMethod, and in the client side, you can call that using JavaScript.

Example:

This example shows how to get the value of a session variable. Note that the method must be Shared - which means that it does not know of any member values on the page object.

As for all ASP.NET AJAX functionality, you need to have a ScriptManager element on the page. To enable page methods, you also need to add EnablePageMethods="true" to the ScriptManager like this:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />

Server side code (VB):

<Services.WebMethod()> Public Shared Function GetPreviewImages() As String
  Dim lPreviewImages As String = HttpContext.Current.Session("mPreviewImages")
  If lPreviewImages IsNot Nothing Then
    Return lPreviewImages
  Else
    Return ""
  End If
End Function

Client side code:

//Declare the return methods:
function GetPreviewImages_Success(result, userContext, methodName) {
    alert(result);
}
function GetPreviewImages_Failed(error, userContext, methodName) {
    var errorMessage = 'Error in map server method ' + methodName ;
    if(error !== null) errorMessage += '\n' + error.get_message();
    alert(errorMessage);
}

// Call the page method:
PageMethods.GetPreviewImages(GetPreviewImages_Success, GetPreviewImages_Failed);

See also example in C#, which also includes how parameters work in the web method.

awe