Ajax has been very popular for a while, now talk about Ajax feel a bit old-fashioned,-_____-'. At present, the so-called Web2.0 Web site, basically do not use Ajax, like the use of RSS, like a label, pasted up on the 2.0. Ajax specific details not to talk about that the purpose is to let users trigger some operations, the page will not be all refreshed, only to update the "part of the page", loading data in the process, with Loading pictures to indicate that the data is loading, not just look pretty good, but also improve the user's access experience, There's a cool feeling.
As for the Ajax used in asp.net, I think most people are using the Atlas framework in ajax.net/ajaxprofessional or ASP.net 2.0. Because it's all used, I feel like these are not very good Ajax solutions.
Ajaxpro is not very convenient to use, the page needs to be registered in Page_Load, similar to
private void Page_Load (object sender, System.EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax (typeof ( Dataaccess.myajax));
}
and the ASPX page contains a runat=server <Asp:From> tag, so that ajax.net will load some of the common functions used and your custom function, if not <Asp:From> in fact, You can add it manually. However, in my previous application, there are often some problems, such as, often found that the browser status bar will have JS script errors, and at this time you do the Ajax effect will be completely invalidated, the solution is, the Ajax.dll/ajaxpro.dll to be a new cover on it, What is the cause of the problem, not yet known.
As for Atlas, I feel the same way about the DataGrid, well, this kind of control is easy to use and convenient, but when it comes to doing some Web apps, you have to take into account performance and tiering issues. I think in the more formal WEB applications, few people to use the DataGrid to display some data, it is recommended that you try to use less of these controls. In addition, the efficiency of the implementation of Atlas is really not ideal, has been there Loading, waiting for a long time, unexpectedly what happened to the script error, Khan.
Is there any other solution? You can write your own Javascript functions to implement them. However, I recommend this Javascript framework using JQuery, from Baidu Encyclopedia cited a paragraph on its introduction:
JQuery is an excellent JAVASCRĪPT framework after prototype. Its purpose is to--write less,do more, write less code, do more things.
It is a lightweight JS library (only 21k after compression), which is not the other JS library, it is compatible with CSS3, but also compatible with a variety of browsers (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+).
JQuery is a fast, concise javaScript library that makes it easier for users to handle HTML documents, events, animations, and easily provide AJAX interaction for the site.
One of the big advantages of jQuery is that it has a full documentation and a variety of applications that are detailed, as well as a number of mature plug-ins to choose from.
JQuery enables the user's HTML page to keep the code and HTML content separate, that is, you don't have to insert a bunch of JS into the HTML to invoke the command, just define the ID.
It seems that this introduction you will know, Ajax effect is only one of the many functions of jQuery, in general, the use of Ajax in the Web application, must also be inseparable from Javascript, and JQuery is for everyone to encapsulate some JS functions, so that you are not in the complexity of JS worry, all By JQuery to help you achieve.
To see a small example, you know that using JQuery to do Ajax is too convenient.
For example, there is a Button in an ASPX or HTML page, and clicking on the trigger Ajax loading data is displayed in the <span id=news>. Click the Button to trigger a JS function:
function Getnews ()
{
$ ("#News"). HTML ("Loading News ...");
$.ajax ({
type: "Post",
URL: "/ajax.aspx?act=getnews",
dataType: "HTML",
Data: "",
success: function (Result)
{
$ (' #News '). HTML (result);
}
}
This function will first display in that SPAN "Loading News ...", through the asynchronous invocation, Access/ajax.aspx This page, by passing the URL parameter act=news tell the page what kind of data, you can according to different parameters, the data through Ajax.aspx directly to the page, and then return to the above JS function, presented to the page, so simple to fix!
The above content is to share the asp.net and the Ajax realization Way, hoped everybody likes.