. , Ajax , , . , , Accordion RadioButtonList (RBL). RBL . . , , , . , , Ajax Control Toolkit. , (http://blog.smarx.com/posts/the-case-of-the-radiobuttonlist-half-trigger.aspx), 2007 , , , .
, , , - . , , onclick RBL, . Visible = false, . : none; , , - , , , . Autopostback = "True" RBL.
CAVEAT: onclick, RBL, . , onclick AsyncPostBack, codebehind , , , . , : Page_Load(), rbl_Questions_SelectedIndexChanged() , RBL . .
:
- .Aspx:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="rbl_Questions" runat="server"
OnSelectedIndexChanged="rbl_Questions_SelectedIndexChanged">
</asp:RadioButtonList>
<asp:Button ID="btn_rbl_Questions" runat="server" style="display:none;"/>
<asp:Label ID="lbl_Result" runat="server" Text="" Visible="false">
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Page_Load():
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
rbl_Questions.Attributes.Add("onclick",
"document.getElementById('"
+ btn_rbl_Questions.ClientID
+ "').click();");
}
}
rbl_Questions_SelectedIndexChanged():
protected void rbl_Questions_SelectedIndexChanged(object sender, EventArgs e)
{
}
05/24/2011
" hack" ( , ). , SO :
Updatepanel postback asyncpostback
, , Page_Load(), , Aspx, ClientIDMode = "AutoID" AutoPostBack = "True" , UpdatePanel .
- .Aspx:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:RadioButtonList ID="rbl_Questions" runat="server"
ClientIDMode="AutoID" AutoPostBack="true"
OnSelectedIndexChanged="rbl_Questions_SelectedIndexChanged">
</asp:RadioButtonList>
<asp:Label ID="lbl_Result" runat="server" Text="" Visible="false">
</asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
MS ClientID .net 4.0 "AutoID" "", , ScriptManager UpdatePanel , . , , .