Ajax.net series tutorial 1: deploy Ajax. net

Source: Internet
Author: User

This seriesArticleIn fact, it is not a tutorial. It can only be used as the next study note. All content is taken from the "How do I? "Series video tutorials. In the following explanation, I will list the corresponding video tutorials. Competent friends can watch them on their own. If you do not understand what foreigners say, you can also refer to my study notes.

This series of articles mainly introduces how to use ajax.net, and focuses on how to use various controls in the Ajax-toolkit of ajax.net.

Here we will not repeat what is ajax.net and its glorious history. We will start directly.

Step 1: Install ajax.net.

Installing ajax.net is simple, but before installing the ajax.net extension package, make sure that we have installed vs. NET 2005 or visual web developer 2005 express edition and. Net frameworks 2.0 correctly.

You can log on to the official website of ajax.net to download the ajax.net extension package. Http://ajax.asp.net/downloads/default.aspx? Tabid = 47

After the download is complete, double-click the installation. After the installation, you can take a look at the update documentation to see what functions have been updated by ajax.net.

Step 2: Create an Ajax-enabled website

Open vs. net2005 and choose "New Website". If you have successfully installed the ajax.net extension package, you will find that the Project template contains the Asp.net Ajax-enabled web site. Select it and create a new website.

After creating a website, you will find that the Ajax-enabled website has an additional scriptmanager control than the normal website. Scriptmanager is a very important control of ajax.net. It can only appear once on a page (if masterpage is used, the subpage cannot be used after masterpage uses scriptmanger ), handles all the ajax.net components and partial updates on the current page. It can also specify the required script library to provide more flexible operations. For more details, see the msdn description.

Step 3: Build a simple ajax.netProgram

We can drag two label controls and a button control to enter the design window, and then write a common Asp.net program, such as outputting a date to two label controls.

After running, we can see the expected results. Every time you click the button, the page will be refreshed and the time on both labels will change. So how can we use ajax.net to make the function the same, but the page will not be refreshed. We need to use the updatepanel control.

Drag the updatepanel control from the toolbar, drag one of the label controls and the button control into the updatepanel range, and then run.

We can find that when we click the button again, the label control in updatepanel will still change the display time, and the page will not be refreshed, but the label control outside updatepanel does not change. This is the local refresh of ajax.net. The control in the updatepanel range changes the logic and does not need to request the page again. While controls other than updatepanel may change the value according to logic, their changes cannot be reflected because the pages are not requested again, so there is no change.

We can also pull the Button out of updatepanel to achieve the same effect, but we need to define the trigger condition of updatepanel. We switch to the HTML mode and fill in the triggerCode, As shown in:

Run, the effect is the same as just now.

End:

This section describes how to install the ajax.net extension package and how to build a simple ajax.net website. You can use the above examples to draw a lot of simple Ajax effects.

Source code: Http://download.csdn.net/source/521048

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.