Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1215
WebSplitter Changes Control ID's
posted

I have an Infragistics WebSplitter on an aspx page.  I added the following Textbox control inside the splitter and after running the page found that the ID of the control had been changed to:

"WebSplitter1_tmpl0_TextBox1".  The "WebSplitter1_tmpl0_" was added by the splitter.

This doesn't happen to controls outside the splitter panes.

Why is this happening?  How can I stop it?  What are the consequenses of stopping this from happening?  How can I possibly use JavaScript to find controls when they have random ID's?

 

Original code:

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 

Choose View, Source on the page after running it and you see this:

<input name="WebSplitter1$tmpl0$TextBox1" type="text" id="WebSplitter1_tmpl0_TextBox1" />

 

 

Parents
No Data
Reply
  • 17559
    Verified Answer
    posted

    Hello raywhite ,

     

    The behavior that you mentioned is by design- you can notice that similar issue is happening if you define your controls in form which is placed inside a master page, if you use ItemTamplates and so on.

     In order to resolve this you can just set  ClientIDMode="Static" to all of the controls that you want:

                    <asp:TextBox ClientIDMode="Static"   ID="TextBox1" runat="server"></asp:TextBox>

     

    For additional reference on the matter you can check the following link:

    http://msdn.microsoft.com/en-us/library/system.web.ui.clientidmode.aspx

     

    If you need any additional assistance on the matter please feel free to ask.

Children