RadioButtonList won't show
-
Hey. I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList something like
<asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate> table></HeaderTemplate ItemTemplate> td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton> <anthem:PlaceHolder id="phPt" runat="server"> <asp:Literal ID="liPt" Runat="server"></asp:Literal> <asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList> </anthem:PlaceHolder></td
And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true" something likeprivate void OnPt(object sender, ImageClickEventArgs e) { MiBlo.Product bloProduct = null; Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender; try { System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent; int lngProductID = int.Parse(aibtnPartType.CommandName); int lngCatalogID = int.Parse(aibtnPartType.CommandArgument); bloProduct = new MiBlo.Product(); DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID); aibtnPartType.UpdateAfterCallBack = true; aibtnPartType.Visible = false; Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); Literal liPt = (Literal)phPt.FindControl("liPt"); liPt.Text = ""; liPt.Visible = false; RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt"); rblPt.Visible = true; rblPt.RepeatColumns = 1; for(int i = 0; i < dvProductPartTypes.Count; i++) { RadioButton rb = new RadioButton(); rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString(); rb.GroupName = "rblPt"; rblPt.Controls.Add(rb); } phPt.UpdateAfterCallBack = true; } catch (Exception err) { lblMessage.Text += err.Message; }
-
Hey. I have a anthem:PlaceHolder inside a asp:Repeater that contains an asp:RadioButtonList something like
<asp:repeater id="rp" runat="server" gt;<br="" mode="hold" />HeaderTemplate> table></HeaderTemplate ItemTemplate> td><anthem:ImageButton id="ibPt" runat="server"></anthem:ImageButton> <anthem:PlaceHolder id="phPt" runat="server"> <asp:Literal ID="liPt" Runat="server"></asp:Literal> <asp:RadioButtonList ID="rblPt" Runat="server" Visible="False"></asp:RadioButtonList> </anthem:PlaceHolder></td
And I have added a click event on my anthem:ImageButton that shall fill the RadioButtonList with items and make it Visible="true" something likeprivate void OnPt(object sender, ImageClickEventArgs e) { MiBlo.Product bloProduct = null; Anthem.ImageButton aibtnPartType = (Anthem.ImageButton)sender; try { System.Web.UI.WebControls.RepeaterItem riSL = (System.Web.UI.WebControls.RepeaterItem)aibtnPartType.Parent; int lngProductID = int.Parse(aibtnPartType.CommandName); int lngCatalogID = int.Parse(aibtnPartType.CommandArgument); bloProduct = new MiBlo.Product(); DataView dvProductPartTypes = bloProduct.GetProductPartTypes(lngProductID, lngCatalogID); aibtnPartType.UpdateAfterCallBack = true; aibtnPartType.Visible = false; Anthem.PlaceHolder phPt = (Anthem.PlaceHolder)riSL.FindControl("phPt"); Literal liPt = (Literal)phPt.FindControl("liPt"); liPt.Text = ""; liPt.Visible = false; RadioButtonList rblPt = (RadioButtonList)phPt.FindControl("rblPt"); rblPt.Visible = true; rblPt.RepeatColumns = 1; for(int i = 0; i < dvProductPartTypes.Count; i++) { RadioButton rb = new RadioButton(); rb.Text = dvProductPartTypes[i]["dblNumberInUnit"].ToString(); rb.GroupName = "rblPt"; rblPt.Controls.Add(rb); } phPt.UpdateAfterCallBack = true; } catch (Exception err) { lblMessage.Text += err.Message; }