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?
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?