radio button list event not firing all the time

Coldy1984

New Member
I have a very strange issue with a radio button list where it works fine but after a few clicks it doesn't seem to fire the SelectedIndexChanged event and just remains on the same value after postback.\[code\]<asp:RadioButtonList runat="server" ID="rblShowRecords" AutoPostBack="true" OnSelectedIndexChanged="rblShowRecords_SelectedIndexChanged" RepeatDirection="Horizontal"> <asp:ListItem >Show Active/Completed</asp:ListItem> <asp:ListItem >Show Active</asp:ListItem> <asp:ListItem >Show Completed</asp:ListItem></asp:RadioButtonList> \[/code\]Here is the event method:\[code\]protected void rblShowRecords_SelectedIndexChanged(object sender, EventArgs e) { switch (rblShowRecords.SelectedItem.Text) { case "Show Active/Completed": CEDatabaseSource.SelectCommand = ConfigurationManager.AppSettings["SelectAllRecords"].ToString();//"SELECT * FROM [CERecord] ORDER BY [Priority]"; break; case "Show Active": CEDatabaseSource.SelectCommand = ConfigurationManager.AppSettings["SelectActiveRecords"].ToString(); break; case "Show Completed": CEDatabaseSource.SelectCommand = ConfigurationManager.AppSettings["SelectCompletedRecords"].ToString(); break; default: break; } CEDatabaseSource.DataBind(); //Commit the changes to the data source. gvRecordList.DataBind(); //Update the GridView rblShowRecords.SelectedItem.Value = http://stackoverflow.com/questions/15462042/CEDatabaseSource.SelectCommand; //Update the value of the selected radio button with the selected SELECT command. }\[/code\]I don't understand why it only works precisely 3 times but after, it never enters the method above.Trying the same thing but with a dropdownlist, also works 3 times and then this error:\[code\]Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation\[/code\]
 
Back
Top