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

RadPageViews & Dynamic Controls & Postbacks

1 Answer 48 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Marnix Bouwman
Top achievements
Rank 2
Marnix Bouwman asked on 04 May 2010, 09:35 AM
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
                    LoadGeneralSettings()
                Case 1
                    LoadMembershipSettings()
                Case 2
                    LoadUsersSettings()
                Case 3
                    ...
                Case 4
                    ...
            End Select
        End Sub
#End Region

And:

#Region "LoadMembershipSettings"
        Sub LoadMembershipSettings()
            Dim gMembershipSettings As MB.Modules.gMembershipSettings = LoadControl("~/DesktopModules/MB/ControlPanel/gMembershipSettings.ascx")
            gMembershipSettings .ModuleConfiguration = Me.ModuleConfiguration
            rpvMembershipSettings.Controls.Add(gMembershipSettings )
            gMembershipSettings.getsettings()
        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
     gMembershipSettings.getsettings()
end if

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

So what should I do?


1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 07 May 2010, 11:34 AM
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,
Yana
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.
Tags
TabStrip
Asked by
Marnix Bouwman
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or