示例效果:
通过(asp:RadioButtonList) radlst_RegKind的点选
将所行值提交给(asp:TextBox) txt_RegKind
----------
HTML部分的代码示例如下:
<%@ Register Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TextBox ID="txt_RegKind" runat="server" ></asp:TextBox>
<cc1:PopupControlExtender ID="popCtl_RegKind" runat="server"
TargetControlID="txt_RegKind" PopupControlID="pnl_RegKind"
CommitProperty="" CommitScript="" Position="Bottom" >
</cc1:PopupControlExtender>
<asp:Panel ID="pnl_RegKind" runat="server" CssClass="popupControl">
<asp:RadioButtonList ID="radlst_RegKind" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="radlst_RegKind_SelectedIndexChanged" Width="130px">
<asp:ListItem Value="1">1.非农业户口</asp:ListItem>
<asp:ListItem Value="2">2.农业户口</asp:ListItem>
<asp:ListItem Value="9">9.其他</asp:ListItem>
</asp:RadioButtonList>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</form>
后台cs部分的代码示例如下
protected void radlst_RegKind_SelectedIndexChanged(object sender, EventArgs e)
{
popCtl_RegKind.Commit(this.radlst_RegKind.SelectedItem.Text);
}