The purpose of using Ascx is to improve the reuse of a certain part of the function, I simply say through the source code to its parameters input and number.
We take the provincial urban three-level link as an example.
VS2005 The following ascx page code:
<table width= "100%" border= "0" cellpadding= "0" cellspacing= "0" >
<tr>
<td>
<asp:dropdownlist id= "ddlprovince" runat= "Server" width= "100px" autopostback= "True" onselectedindexchanged= " Ddlprovince_selectedindexchanged ">
</asp:DropDownList>
<asp:updatepanel id= "UpdatePanel1" runat= "Server" rendermode= "Inline" >
<ContentTemplate>
<asp:dropdownlist id= "ddlcity" runat= "Server" width= "100px" autopostback= "True" onselectedindexchanged= "DdlCity_" SelectedIndexChanged ">
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:asyncpostbacktrigger controlid= "ddlprovince" eventname= "SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
<asp:updatepanel id= "UpdatePanel2" runat= "Server" rendermode= "Inline" >
<ContentTemplate>
<asp:dropdownlist id= "ddldistrict" runat= "Server" width= "100px" >
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:asyncpostbacktrigger controlid= "ddlcity" eventname= "SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
</table>