Migrate your Web page to asp.net AJAX 1.0

Source: Internet
Author: User

If you use the Atlas control Toolkit in your Web site, this article will help you migrate your Web pages to asp.net Ajax 1.0, translated from the ASP.net Ajax control Toolkit website.

With the release of the ASP.net AJAX 1.0 beta release, a number of fundamental changes have been introduced, one of which is the removal of the "Targetproperties" object from the original version.

Luckily, migrating your Web pages to new forms is very simple, just follow the steps below:

First step: Update references

First, the name of the Assembly toolkit has changed, updating your Web site's references from Atlascontroltoolkit to AjaxControlToolkit, and then updating all the register directives on your Web page.

<%@ Register

Assembly= "Atlascontroltoolkit"

Namespace= "Atlascontroltoolkit"

tagprefix= "Atlastoolkit"%>
Modified to:
<%@ Register

Assembly= "AjaxControlToolkit"

Namespace= "AjaxControlToolkit"

tagprefix= "Ajaxtoolkit"%>
The second step is to create a extender instance for each Property object

The new asp.net AJAX extensions remove targetproperties, each attribute is now directly defined as extender, so each attribute object in your original code requires a extender instance.

<atlastoolkit:confirmbuttonextender

Id= "CBE1" runat= "Server" >

<atlastoolkit:confirmbuttonproperties

Targetcontrolid= "LinkButton1"

confirmtext= "Delete Item?"/>

<atlastoolkit:confirmbuttonproperties

Targetcontrolid= "LinkButton2"

confirmtext= "Update Item?"/>

</atlasToolkit:ConfirmButtonExtender>
Modified to:

<ajaxtoolkit:confirmbuttonextender

Id= "CBE1" runat= "Server"/>

<ajaxtoolkit:confirmbuttonextender

Id= "Cbe2" runat= "Server"/>

Step three remove the attribute declaration from the Extender

The copy attribute is declared from the Property object to the new extender instance.

<ajaxtoolkit:confirmbuttonextender

Id= "Cbe12"

runat= "Server"

Targetcontrolid= "LinkButton1"

confirmtext= "Delete Item?"/>

<ajaxtoolkit:confirmbuttonextender

Id= "Cbe2"

runat= "Server"

Targetcontrolid= "LinkButton2"

Confirmtext= "UpdateItem?"/>

Step fourth (optional) Migration ID to Behaviorid

If you refer to the ID of the component in the attribute object, the value in Extender is "Behaviorid".

<atlastoolkit:confirmbuttonextender

Id= "CBE1" runat= "Server" >

<atlastoolkit:confirmbuttonproperties

Id= "ConfirmBehavior1"

Targetcontrolid= "LinkButton1"

Confirmtext= "Delete?"/>

</atlasToolkit:ConfirmButtonExtender>

<script type= "Text/javascript" >

function dosomething () {

var B = $object ("ConfirmBehavior1");

B.confirm ();

}

</script>
Modified to:

<ajaxtoolkit:confirmbuttonextender

Id= "Cbe1"

Behaviorid= "ConfirmBehavior1"

runat= "Server"

Targetcontrolid= "LinkButton"

Confirmtext= "Delete?"/>

<script type= "Text/javascript" >

function dosomething () {

var B = $find ("ConfirmBehavior1");

B.confirm ();

}

</script>

Complete!

Original: Http://ajax.asp.net/ajaxtoolkit/Walkthrough/AtlasToAspNetAjax.aspx
Http://www.cnblogs.com/Terrylee/archive/2006/10/21/atlas_to_aspnet_ajax.html

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.