Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Tabstrip > Tabs+PageView Dynamic Pages+Dynamic Controls
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered Tabs+PageView Dynamic Pages+Dynamic Controls

Feed from this thread
  • Posted on Feb 12, 2008 (permalink)

    Hello, have a situation where we dynamicly create TABS, and PageViews
    thank in each dynamicly created pageview I would like to load a user control (same user control loaded in each pageview).
    This control has form fields and will show/hide various fields based on what tab is clicked on parent page.
    It will
    This form controls inside of the userControl need to persist data between tab clicks. So i supose they should not be reloaded every time the tab is hit, as one of the example suggest.
    http://demos.telerik.com/aspnet-classic/TabStrip/Examples/Application/DynamicControls/DefaultCS.aspx

    I have looked around, seem like many of people having trouble with similar scenarious.
    I open to any suggestions or workaround to make this work.

    Another thing that complicates stuff, is that i have Rad Combobox in the loaded user control, that is when item is picked rebinds the form controls.
    The ides, is to have that being AJAXified, but so far i cannot put it together.


  • Atanas Korchev Atanas Korchev admin's avatar

    Posted on Feb 12, 2008 (permalink)

    Hello James Van Buren,

    This example demonstrates the correct way to dynamically create tabs, pageviews and create controls. For loading user controls you can check this example.

    To locate controls in different user controls you should first find the specific user control using the FindControl method:

    Control firstPage = Page.FindControl("myUserControlID"); //or RadTabStrip1.PageViews[0].Controls[0]

    Then you need to locate the controls which need rebinding:

    TextBox myText = (TextBox)firstPage.FindControl("myTextBoxID");

    To ajaxify the tabstrip you can simply put it inside a RadAjaxPanel.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Feb 28, 2008 (permalink)

    Can I access AjaxManager on the parent page from inside of the loaded user control? Can I use IT to AJAXify controls inside of the userControl?

  • Posted on Feb 28, 2008 (permalink)

    Ok, I am still trying to figure this thing out.
    I follow this example , and this is what i have been doing before, but i guesss what complicates our situation is that I load same userControl 3 times into different pageviews that are dynamicly created together with tabs.
    but inside of the user control, i have ajax update scenario, where when item in dropbox is selected the fields are filled with data.
    What is happening is I AJAXIFY the link button and the PANNEL with content inside of the loaded user control
    the actual ajaxmanager and scriptmanager are on the parent page

    Dim rajaxMan As Telerik.Web.UI.RadAjaxManager = DirectCast(Me.Page.FindControl("RadAjaxManager1"),   
    Telerik.Web.UI.RadAjaxManager)  
    rajaxMan.AjaxSettings.AddAjaxSetting(Me.linkPickADriver,   
    Me.DriverInfoPannel, Nothing

    When the linkbutton is clicked what is happening is the parent page is reloading all the controls, tabs and pageviews all over again.

    So when the linkbuttion is presses
    rmpServiceContacts_PageViewItemCreated event is fired 3 times 1 for each pageview, than the Load Event of the UserControl is fired 3 times, and than the actual click event is fired, making code inside of it useless, as the control was completly reloaded.

    Any suggestions?

    I am trying to have ajaxified partial postback inside of the loaded usercontrol, i dont want control to be reloaded.

  • Atanas Korchev Atanas Korchev admin's avatar

    Posted on Mar 3, 2008 (permalink)

    Hello James Van Buren,

    Using Ajax requires all controls to be loaded on the server side. Otherwise the server-control life-cycle will be broken and various ASP.NET features (viewstate, postback events) won't work at all. The behavior you are observing (PageViewItemCreated firing 3 times (once per pageview), load event of the user controls firing 3 times(once per user control in the pageview)) is expected.
    I cannot understand the following statement: "the actual click event is fired, making code inside of it useless, as the control was completly reloaded." What is the code in the click event doing? Why does it become useless?

    "I am trying to have ajaxified partial postback inside of the loaded usercontrol, i dont want control to be reloaded."
    This is not possible. RadAjax (and ASP.NET Ajax) require all controls to be loaded once an ajax request is made. Then only a small portion of the page HTML is updated - namely the controls which are configured to be updated by RadAjaxManager (or controls inside the ASP.NET Ajax update panel).

    I hope this helps,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Mar 3, 2008 (permalink)

    ""I am trying to have ajaxified partial postback inside of the loaded usercontrol, i dont want control to be reloaded."
    This is not possible. RadAjax (and ASP.NET Ajax) require all controls to be loaded once an ajax request is made. Then only a small portion of the page HTML is updated - namely the controls which are configured to be updated by RadAjaxManager (or controls inside the ASP.NET Ajax update panel).
    "

    Let me clarify a bit.
    iniside of the dynamicly loaded userControl (Ctrl1) i have a code that saves the values of the form, so when the link button is clicked inside of  Ctrl1, the control itself is being reloaded, and the changed values are being lost.
    I have a radCombo box inside of the ctrl1 that has list of users, when i select a different user and hit the 'SELECT USER' linkbutton, I am trying to get to rebind the form controls based on the user selected in combo box, but the selected index of the combox is NOTHING, as the whole control has just been reloaded.

    Maybe it's the problem with ComboBox, or what am i doing wrong?

  • Atanas Korchev Atanas Korchev admin's avatar

    Posted on Mar 3, 2008 (permalink)

    Hi James Van Buren,

    I have created a simple web page utilizing RadTabStrip and dynamic user controls. It does not use ajax but I think it should work as expected if everything is wrapped inside an update panel (or ajax panel).

    If this example does not help please open a support ticket and send us a sample web page which demonstrates your problem. This will greatly help us to provide a solution. Thanks.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Ryan Salt avatar

    Posted on Mar 22, 2008 (permalink)

    Hi Albert

    I'm having the same problem as James.

    I'm loading user controls dynamically into a multipageview depending on which tab in the tabstrip is clicked. One of the controls contains a HTML upload field and some image manipulation code, which requires a postback. The problem is that when the page is posted back to the server, the AJAX recreates the entire control, and loads nothing into the current pageview, not even the control I was just using.
    I assume it has something to do with viewstate, but i'm not sure how to make sure that the viewstate is recording the currently loaded controls properly.

  • Ray Covington avatar

    Posted on May 25, 2011 (permalink)

    I need an answer to this; however; ALL of the resources you provided are dead links "nice". Could  you please re-post with the correct resources?

  • Peter Peter admin's avatar

    Posted on May 30, 2011 (permalink)

    Hi Ray,

    I have fixed the broken links so you go ahead and view the demos.

    Apologies for the caused inconvenience.

    Regards,
    Peter
    the Telerik team

    Consider using RadControls for ASP.NET AJAX (built on top of the ASP.NET AJAX framework) as a replacement for the Telerik ASP.NET Classic controls, See the product support lifecycle here.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Tabstrip > Tabs+PageView Dynamic Pages+Dynamic Controls