SakiMakito
New Member
I've got a user control containing the following piece of code;\[code\]<%@ Control Language="vb" %><script language="javascript" type="text/javascript"> $(document).ready(function () { //set selection indicator shape var selectionIndicator = $(".sisconfigpage_rbl_selectionindicator"); var selectionLocation = $(".sisconfigpage_rbl_vorm").find("input:checked").parent(); selectionIndicator.appendTo(selectionLocation); });</script><asp
laceHolder runat="server" ID="step2Placeholder"> <asp:RadioButtonList ID="shapeRBL" runat="server" /></asp
laceHolder><asp
laceHolder runat="server" ID="step3Placeholder"> <asp:TextBox ID="lengthTB" runat="server" /> <asp:TextBox ID="widthTB" runat="server" /> </asp
laceHolder>\[/code\]In the code behind file for the usercontrol we use FinControl to find the right controls and load data taken from a database into them. The controls are found like this;\[code\] step2PlaceHolder = Me.FindControl("step2Placeholder") shapeRBL = step2PlaceHolder.FindControl("shapeRBL")\[/code\]The radiobuttonlist is begin filled and data is shown as expected. Also some properties are set from the code behind file;\[code\]shapeRBL.RepeatDirection = RepeatDirection.HorizontalshapeRBL.CssClass = "sisconfigpage_rbl_vorm"shapeRBL.RepeatLayout = RepeatLayout.FlowshapeRBL.ToolTip = String.Format("{0} {1}", SISTranslate.Translate("Selecteer een", Id, "Algemeen"), Step2Name.ToLower)shapeRBL.ID = "shapeRBL"shapeRBL.AutoPostBack = True'After this we take a set of records from the database and fill the radiobuttonlist.\[/code\]The problem however occurs in the postback when a radiobutton is clicked (note that on initial pageloada pre-selection is being made). We expect the SelectedIndexChanged event to go off as soon as an user clicks a radiobutton from the list. But on the first click the postback is begin done, but the SelectedIndexChangedEvent doesn't fire, due to this the selected item isn't set. When clicking the same (or another item) again so a second postback fires, the event is being hit! So somehow on the first postback, after making a selection from the RadioButtonList the event doesn't fire. What could possibly go wrong here? The SelectedIndexChanged event is like this;\[code\]Protected Sub shapeRBL_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles shapeRBL.SelectedIndexChanged Dim SelectedValue As String = shapeRBL.SelectedValue OrderLine.Shape = SelectedValueEnd Sub\[/code\]



