how can I create dynamically web splitter?
I have problems with its server side id.
thanks
Leslie Mann
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,
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";
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?
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.