很多时候我们需要用到User Control将部份UI或业务逻辑包装下面将UserControl包装成AspNet ajax 控件:
简单示例:
(ASCX) 这一段代码就不解释了:
<table>
<tr>
<td>
LoginName:
td>
<td>
<asp:TextBoxID=UserNameRuant=Server>asp:TextBox>
td>
tr>
<tr>
<td>
Password:
td>
<td>
<asp:TextBoxID=PasswordTextMode=PasswordRuant=Server>asp:TextBox>
td>
tr>
table>
(LoginPaneljs)
<scripttype=text/javascript>
///
TyperegisterNamespace(CsharpFarmer);
CsharpFarmerLoginPanel=function(element){
CsharpFarmerLoginPanelinitializeBase(this[element]);
thisuserName=null;
thispassword=null;