Ways to develop web programs under. NET 2.0 using Ajax in VS2008

Source: Internet
Author: User
Tags add config copy datetime net version tostring visual studio
First install ASP.net AJAX Extensions This feature is the Client-side feature that provides. NET 2.0 development Ajax
Next, install the Microsoft ASP.net 2.0 AJAX templates for Visual Studio 2008 Template Suite

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 CodeThe code is 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 CodeThe code is 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 CodeThe code is 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"/>
<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"/>
<asp:button id= "Button1" runat= "Server" text= "Update"/>
</div>
</form>

Background:
Copy CodeThe code is as follows:
protected void button2_click (object sender, EventArgs e)
{
Labletime.innertext = DateTime.Now.ToString ();
}

Run, the successful implementation of no refresh.



Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

11.11 Big Sale for Cloud

Get Unbeatable Offers with up to 90% Off,Oct.24-Nov.13 (UTC+8)

Get It Now >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.