How to use AJAX to develop web programs under. NET 2.0 in vs2008-practical tips

Source: Internet
Author: User
Install first asp.net ajax ExtensionsThis feature is a client-side feature that provides. NET 2.0 development Ajax
Next InstallMicrosoft asp.net 2.0 AJAX Templates for Visual Studio 2008Template Kits

This allows you to select an Ajax template in vs2008
However, you must modify the Web.config settings to specify a specific component version
The easiest way to do this is to create a new AJAX page and then copy the Web.config content from the old page without adding some overlay.

Add the following settings

Copy Code code as follows:

<pages>
<controls>
<add tagprefix= "asp" namespace= "System.Web.UI" assembly=, System.Web.Extensions, version=1.0.61025.0 Neutral, publickeytoken=31bf3856ad364e35 "/>
</controls>
</pages>

Next Join
Copy Code code as follows:

<compilation debug= "true" strict= "false" explicit= "true" >
<assemblies>
<add assembly= "System.Web.Extensions, version=1.0.61025.0, culture=neutral, publickeytoken=31bf3856ad364e35"/ >
<add assembly= "System.Web.Extensions.Design, version=1.0.61025.0, Culture=neutral, publickeytoken= 31bf3856ad364e35 "/>
</assemblies>
</compilation>

Create a new page and copy the following code:
Copy Code code as follows:

<form id= "Form1" runat= "Server" >
<asp:scriptmanager id= "ScriptManager1" runat= "Server"/>
<div>
<asp:updatepanel id= "UpdatePanel1" runat= "Server" >
<ContentTemplate>
<label runat= "Server" id= "Labletime" >
</label>
<% =datetime.now.tostring ()%>
<asp:button id= "Button3" runat= "Server" text= "Update" onclick= "Button2_Click"/>
<asp:timer id= "Timer1" runat= "Server" interval= "1000" >
</asp:Timer>
</ContentTemplate>
<Triggers>
<asp:asyncpostbacktrigger controlid= "Button2" eventname= "click"/>
</Triggers>
</asp:UpdatePanel>
<br/>
<% =datetime.now.tostring ()%>
<asp:button id= "Button2" runat= "Server" text= "Update" onclick= "Button2_Click"/>
<asp:button id= "Button1" runat= "Server" text= "Update"/>
</div>
</form>

Background:
Copy Code code as follows:

protected void button2_click (object sender, EventArgs e)
{
Labletime.innertext = DateTime.Now.ToString ();
}

Run, the successful implementation of no refresh.

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.