c# - AJAX Control Toolkit TabContainer Throws Specified Argument Out of Range of Valid Values -


we using ajax control toolkit , have placed updatepanel in page. page layout controlled master page. updatepanel contains numerous server side controls. code snippet initiate updatetepanel is:

<asp:updatepanel id="updatepanel1" runat="server">     <triggers>         <asp:postbacktrigger controlid="btnsubmit" />     </triggers> 

inside updatepanel, there resides tabcontainer numerous server side controls. code-behind references as:

        tabpanel tabpanel3 = new tabpanel();     tabpanel3.headertext = "manually enter allergy";     tabcontainer1.controls.add(tabpanel3);     (int k = 1; k <= 6; k++)     {         //checkbox cb1 = new checkbox();         //cb1.id = "cbother" + k;         textbox txt = new textbox();         txt.id = "txtaother" + k;         txt.cssclass = "finput";         literal lt = new literal();         lt.text = "<br/>" + k + ".&nbsp;";         //tabpanel3.controls.add(cb1);         tabpanel3.controls.add(lt);         tabpanel3.controls.add(txt);      } 

the tabcontainer setup follows:

<asp:tabcontainer id="tabcontainer1" runat="server" activetabindex="0"> </asp:tabcontainer> 

when run page locally, receive following error:

description: unhandled exception occurred during execution of current web  request. please review stack trace more information error ,  originated in code.    exception details: system.argumentoutofrangeexception: specified argument out of t range of valid values. parameter name: value  source error:   unhandled exception generated during execution of current web request.  information regarding origin , location of exception can identified  using exception stack trace below.  stack trace:    [argumentoutofrangeexception: specified argument out of range of valid values. parameter name: value] ajaxcontroltoolkit.tabcontainer.set_activetabindex(int32 value) +255 ajaxcontroltoolkit.tabcontainer.oninit(eventargs e) +121 system.web.ui.control.initrecursive(control namingcontainer) +605 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.control.initrecursive(control namingcontainer) +323 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean    includestagesafterasyncpoint) +2238 

i'm having difficulty understanding why error being thrown. initial searches don't yield definitive course of action. can provide guidance done remedy error?

i'm guessing in aspx have no tabpanels. why getting error, because index 0 not valid until populate tabs in pageload.

get rid of activetabindex=0 in markup, , after have added tabs programmatically, call there:

tabcontainer1.activetabindex=0;


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -