很多時候我們需要用到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;
From:http://tw.wingwit.com/Article/program/net/201311/15451.html