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
1810
Creating dynamically
posted

how can I create dynamically web splitter?

I have problems with its server side id.

thanks

Leslie Mann

  • 25665
    Offline posted

    Hello Leslie,

    Thank you for contacting Infragistics!

    I have a couple questions concerning this matter:

    What do you mean by dynamically creating?
    Do you place it on the form and then want to do the rest of the setup in code behind?
    Or are you trying to add it to the form from the code behind?
    What issues are you having with the server side id?

    I am looking forward to hearing from you,

    • 1810
      Offline posted in reply to Michael Peterson
      Hi Mike, thanks for your quick answer.
      I'm trying to add it to the form from code behind! In fact the idea is to place to many as needed.
      The problem is there is no server id between postbacks.
      Thank you in advance
      Ricardo
      • 25665
        Offline posted in reply to Ricardo Calvo

        Hello Ricardo,

        Because you are creating the control in the code behind instead of in markup you are reasonable for re-creating it on postback. For example if you were creating a Label on the page:

                Label Label1 = new Label();
                Label1.ID = "Label1";
                Label1.Text = "Label1";
                PlaceHolder1.Controls.Add(Label1);

        You would have to perform that logic on every postback to re-create the label. Then say later in a different event you wanted to change the label you would have to go through the place holder element to get it:

                Label label1 = (Label)PlaceHolder1.FindControl("Label1");
                label1.Text = "New Text";

        • 1810
          Offline posted in reply to Michael Peterson

          Hello,

          Yes I'm aware about that. The problem with the splitter is that you can't assign a Server ID. Since ASP.NET recreates the data of the components based on that ID, and I can't assign it, it cannot be restored directly (as I would excpected). Do you have a way to do this?

          • 25665
            Offline posted in reply to Ricardo Calvo

            Hello Ricardo,

            Thank you for the update. Concerning the behavior you describe that is expected as when you are adding the controls to the page from the code behind they do not exist until you add them to the page. And when a postback occurs it has to re-add everything back to the page.