RadPageViews & Dynamic Controls & Postbacks

2 posts, 0 answers
  1. Marnix Bouwman
    Marnix Bouwman avatar
    22 posts
    Member since:
    Nov 2009

    Posted 04 May 2010 Link to this post

    Hi, I;m using the tabstrip with a couple of pageviews.
    On each tab/pageview, I am showing some settings for an application I am making.

    So on each tab I am dynamically loading a different usercontrol with a form (with settings which are loaded) and a submit button.
    I'm having touble when trying to find out if a postback is caused by a click on the tabstrip, or on the submit button.

    If I click on a tab (causes a postback), the usercontrol should be loaded, and the form should be filled with the settings which are already present in the database.
    If I click on an update button (causes a postback), the settings of the current usercontrol should be saved back to the database.

    I'm doing this in the main page:

    #Region "RadTabStrip1_TabClick"
            Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As RadTabStripEventArgs) Handles RadTabStrip1.TabClick
                Select Case RadTabStrip1.SelectedIndex
                    Case 0
                    Case 1
                    Case 2
                    Case 3
                    Case 4
                End Select
            End Sub
    #End Region


    #Region "LoadMembershipSettings"
            Sub LoadMembershipSettings()
                Dim gMembershipSettings As MB.Modules.gMembershipSettings = LoadControl("~/DesktopModules/MB/ControlPanel/gMembershipSettings.ascx")
                gMembershipSettings .ModuleConfiguration = Me.ModuleConfiguration
                rpvMembershipSettings.Controls.Add(gMembershipSettings )
            End Sub
    #End Region

    So in gMembershipSettings.ascx I have a sub called getsettings, which loads the settings from the database and fills them in the form.
    And I have an eventhandler for the update button which will save the settings to the database.

    However when I click the submit button, it will first load the old settings again, and save those back to the database.

    When I do something like

    if not page.ispostback then
    end if

    It will not load the settings when I click on the tab.

    So what should I do?

  2. Yana
    Yana avatar
    5043 posts

    Posted 07 May 2010 Link to this post

    Hi Marnix Bouwman,

    Could you please try to isolate the issue in a simple project and send it to us as we're not able to understand exactly the scenario? Thanks in advance

    Best regards,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top