Public Class TabStripChildControls Inherits System.Web.UI.Page #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Protected WithEvents MyDNNTabStrip As DotNetNuke.UI.WebControls.DNNTabStrip Protected WithEvents txtRequired As System.Web.UI.WebControls.TextBox Protected WithEvents RequiredFieldValidator1 As System.Web.UI.WebControls.RequiredFieldValidator Protected WithEvents lblRequired As System.Web.UI.WebControls.Label Protected WithEvents tabValidators As DotNetNuke.UI.WebControls.DNNTab Protected WithEvents tabDropDownLists As DotNetNuke.UI.WebControls.DNNTab Protected WithEvents btnPostBack As System.Web.UI.WebControls.Button Protected WithEvents lblTime As System.Web.UI.WebControls.Label Protected WithEvents btnDDLSave As Button Protected WithEvents ddlStatic As DropDownList Protected WithEvents ddlDynamic1 As DropDownList Protected WithEvents txtDropDowns As TextBox 'NOTE: The following placeholder declaration is required by the Web Form Designer. 'Do not delete or move it. Private designerPlaceholderDeclaration As System.Object Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Protected Overrides Sub OnInit(ByVal e As System.EventArgs) MyBase.OnInit(e) DotNetNuke.UI.Utilities.ClientAPI.HandleClientAPICallbackEvent(Me) End Sub Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Me.lblTime.Text = Now.ToString End Sub Private Sub MyDNNLabelEdit_UpdateLabel(ByVal source As Object, ByVal e As UI.WebControls.DNNLabelEditEventArgs) 'update database here End Sub Private Sub tabDropDownLists_SetupDefaults() Handles tabDropDownLists.SetupDefaults If tabDropDownLists.IsPostBack = False Then 'If this is the first time the tab is loaded, we need to set it up PopulateDropDownLists() End If End Sub 'We are populating the dropdowns to simulate viewstate. This event is only fired if 'a tab has been rendered to the client. Shortly after this event the LoadPostData 'event of the dropdowns will be called as part of the ASP.NET lifecycle. 'If the DropDown has items at this point, things like SelectedValue and SelectedItem 'will function. Private Sub tabDropDownLists_PreLoadPostData() Handles tabDropDownLists.PreLoadPostData PopulateDropDownLists() End Sub Private Sub PopulateDropDownLists() Me.ddlDynamic1.Items.Add(New ListItem("Dynamic1Text", "Dynamic1Value")) Me.ddlDynamic1.Items.Add(New ListItem("Dynamic2Text", "Dynamic2Value")) End Sub Private Sub btnDDLSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDDLSave.Click 'The Static dropdownlist does not require the use of viewstate, the values are 'persisted with the aspx markup. However, the dynamic dropdown also works now 'that we populated the items in the PreLoadPostData event. txtDropDowns.Text = "ddlStatic SelectedValue=" & ddlStatic.SelectedValue & vbCrLf & "ddlDynamic SelectedValue=" & ddlDynamic1.SelectedValue End Sub End Class