This is a migrated thread and some comments may be shown as answers.

The content in RadPane clear when postback

3 Answers 137 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
guo jun
Top achievements
Rank 1
guo jun asked on 30 Jul 2009, 04:31 PM
Hi, All,
        I'm a new user. Today, I meet an issue just now. I need your help. Thanks!
        I add one RadSplitter and RadPane dynamic then I set RadPane's ContentUrl. But when page postback, the content in RadPane clear. Does anybody knows why? The following is my code about this issue:
        Some code in .aspx:
            <div id ="uxDivTest" runat ="server">
            </div> 
             <asp:Button ID="btnAdd" runat="server" Text="Add Pane" OnClick="btnAdd_Click" />
             <asp:Button ID="btnTest" runat="server" Text="Refresh Page" onclick="btnTest_Click" />

        Some code in .aspx.cs:

            protected void btnAdd_Click(object sender, EventArgs e) {
                       RadSplitter dispositionSplitter = new RadSplitter();
                       RadPane dispositionPanel = new RadPane();
                       dispositionSplitter.ID = "splitter";
                       dispositionPanel.ID = "panel";
                       dispositionPanel.ContentUrl = "http://www.google.com";
                       dispositionSplitter.Items.Add(dispositionPanel);

                       uxDivTest.Controls.Add(dispositionSplitter);
              }
                
                // postback page

              protected void btnTest_Click(object sender, EventArgs e) {

              }

       When I click Add Pane button, openning google in RadPane. That's all right. But when I click Refresh Page button to postback page, RadPane is empty and google site disappear.
       How shoud I make google appear all the time even when page postback?

       Another question: How shoud I add RadSplitter and RadPane dynamic in Client-Side with javascript?

        Thank you again!
         Jguo

3 Answers, 1 is accepted

Sort by
0
guo jun
Top achievements
Rank 1
answered on 31 Jul 2009, 02:35 AM
Dear Support-Team,

        Could you help me?

        Thank you very much!
        Jguo
0
guo jun
Top achievements
Rank 1
answered on 01 Aug 2009, 04:24 PM
Hi, everybody,

Does any body know how to deal with this?
Please tell me. I will be greatful to you..

Thanks
Jguo
0
Svetlina Anati
Telerik team
answered on 04 Aug 2009, 01:05 PM

Hi guo jun,

When you dynamically create and add controls to a page, you should take care to recreate them again on postback and this is not directly related to RadControls but it is a general ASP.NET knowledge. In your code you do not recreate the splitter and the pane, at least in the code snippets you have provided.

You can find more information about dynamic creation of controls in ASP.NET below:

http://msdn.microsoft.com/en-us/library/kyt0fzt1(VS.80).aspx

Recreating controls after postback - part I and II. Additional information is also available on the net. You can also confirm this yourself by adding standard asp control, e.g a button in teh same scenario and you will get the same result.

On a side note, the forums are considered public resources and we do not guarantee on time response here - if you want to ensure that you will get a faster support, you can take advantage of the different support packages we offer. To get more information about  different support packages and possibilities, please send an email to sales@telerik.com




Kind regards,

Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Splitter
Asked by
guo jun
Top achievements
Rank 1
Answers by
guo jun
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or