I'm in the process of converting all of the WebDateChooser's in my application to the newer WebDatePicker so that I can upgrade to the latest version of your library. In my application I had created a custom control that inherits from CompositDataBoundControl. This control basically would databind to a set of objects and based on the properties of that object it dynamically creates different types of controls (textbox, radio buttons, dropdownlist, WebDateChooser). I've altered my control to start using the WebDatePicker instead of the WebDateChooser, basically just swapping out the control and changing the property names accordingly. However, now that i've done that, the new WebDatePicker control is no longer persisting the selected date upon postback, instead it's keeping the original value that was assigned upon databinding. I'm not sure how to troubleshoot this, so any help would be greatly appreciated. Note, this works without issue when I'm using the WebDateChooser. Thanks.
Hello Mike,
I have no access to the actual code used, and yet what I can suggest is there are some issues with the persistence and the viewState.The following forum thread could provide some hints, as similar issues are discussed and Viktor has provided details regarding the WebDatePicker live cycle “WebDatePicker selected values not persisted to server-side”
Also keep in mind, WebDatePicker uses WebMonthCalendar to display the calendar. This involves adding the WebMonthCalendar to the control’s collection of the page.
A couple of forum threads you may find useful: Dynamically created WebDatePicker non-functional - “A server control (or its container/s) should belong to Form.Controls, but not to Page.Controls. So, application should ensure that any dynamic Control does not appear outside of Form. Of in case of aspx, a control should be inside of <form>. Otherwise, that control will not function correctly on client and/or values modified on client will be not passed to server after a postback.”
Regarding Retired Controls and Events
In general there is a difference between these two controls’ dependencies and architecture. You could find details and compare these at:WebDateChooser:http://help.infragistics.com/Help/Doc/ASPNET/2011.1/CLR4.0/html/WebCalendar_and_WebDateChooser_API_Overview.htmlWebDatePicker:http://help.infragistics.com/doc/ASPNET/2014.1/CLR4.0/?page=WebDatePicker_API_Overview.html
Please let me know how these suggestions work for you!
Thanks for getting back to me. I had already looked through those forum posts but they didn't help my issue. ViewState appears to be persisting just fine upon postback, it's just the actual posted data for the datepicker itself that isn't being set for the control upon postback. I took a look with fiddler and the data being posted to the page looks correct, so it has to be something with the point of loading the posted data into the control. Here is the control I've created:
Imports System Imports System.Collections.Generic Imports System.Collections.ObjectModel Imports System.ComponentModel Imports System.Text Imports System.Web Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Xml Imports Infragistics.Web.UI.EditorControls Imports Infragistics.WebUI.WebDataInput Imports System.Collections 'Imports Infragistics.WebUI.WebSchedule <DefaultProperty("Text"), ToolboxData("<{0}:UDFControl runat=server></{0}:UDFControl>")> _ Public Class UDFControl Inherits CompositeDataBoundControl #Region "Enumerations" Public Enum UDFTypes None = 0 TextBox = 1 MultiLineTextBox = 2 NumericTextBox = 3 DropdownList = 4 CheckboxList = 5 TrueFalseRadioButtons = 6 DateDropdown = 7 End Enum #End Region #Region "Private Fields" Private chklist As New SelectedExplanationCheckboxList Private txtbox As New NetsoftTextBox Private multilinetextbox As New NetsoftTextBox Private datedropdown As New WebDatePicker 'Private datedropdown As New WebDateChooser Private ctlLabel As New Label Private trueRadioBtn As New RadioButton Private falseRadioBtn As New RadioButton Private dropdown As New NetsoftExplanationDropDownList Private numerictxtbox As New WebNumericEdit #End Region #Region "Private Methods" ''' <summary> ''' Returns a break literal control ''' </summary> Private Function GetBreakLiteral() As Literal Dim BreakLiteral As New Literal BreakLiteral.Text = "<br />" Return BreakLiteral End Function ''' <summary> ''' Sets up the check box list for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupCheckBoxList(ByVal lookupds As Object) Controls.Add(chklist) chklist.ID = "CheckList" chklist.DataTextField = Me.DataTextField chklist.DataValueField = Me.DataItemValueField chklist.DataSelectedField = Me.DataSelectedField chklist.DataDefaultSelectedField = Me.DataDefaultSelectedField chklist.DataTextBoxField = Me.DataTextBoxField chklist.DataRequiresTextBoxField = Me.DataRequiresTextBoxField chklist.TextMode = TextBoxMode.MultiLine chklist.ProcessHtmlTags = NetsoftTextBox.HtmlTagOptions.EncodeTags chklist.Rows = Me.Rows If lookupds IsNot Nothing Then chklist.DataSource = lookupds chklist.DataBind() End If End Sub ''' <summary> ''' Sets up the text box for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupTextBox(ByVal lookupds As Object) Controls.Add(txtbox) txtbox.ID = "RegTextBox" txtbox.ProcessHtmlTags = NetsoftTextBox.HtmlTagOptions.EncodeTags ctlLabel.AssociatedControlID = txtbox.ID If lookupds IsNot Nothing Then If TypeOf lookupds Is IEnumerable Then Dim currentRow As IEnumerator = DirectCast(lookupds, IEnumerable).GetEnumerator If currentRow.MoveNext Then ' set the selected value Dim itemtext As String = System.Web.UI.DataBinder.GetPropertyValue(currentRow.Current, DataValueField) If Not String.IsNullOrEmpty(itemtext) Then txtbox.Text = itemtext End If End If End If End If End Sub ''' <summary> ''' Sets up the Multi-line textbox for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupMultiLineTextBox(ByVal lookupds As Object) Controls.Add(multilinetextbox) multilinetextbox.ID = "MultilineTextBox" multilinetextbox.TextMode = TextBoxMode.MultiLine multilinetextbox.ProcessHtmlTags = NetsoftTextBox.HtmlTagOptions.EncodeTags multilinetextbox.Rows = Rows ctlLabel.AssociatedControlID = multilinetextbox.ID If lookupds IsNot Nothing Then If TypeOf lookupds Is IEnumerable Then Dim currentRow As IEnumerator = DirectCast(lookupds, IEnumerable).GetEnumerator If currentRow.MoveNext Then ' set the selected value Dim itemtext As String = System.Web.UI.DataBinder.GetPropertyValue(currentRow.Current, DataValueField) If Not String.IsNullOrEmpty(itemtext) Then multilinetextbox.Text = itemtext End If End If End If End If End Sub ''' <summary> ''' Sets up a numeric text box for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupNumericTextBox(ByVal lookupds As Object) Controls.Add(numerictxtbox) numerictxtbox.ID = "NumericTextBox" ctlLabel.AssociatedControlID = numerictxtbox.ID numerictxtbox.Section508Compliant = True numerictxtbox.SpinButtons.Display = Infragistics.WebUI.WebDataInput.ButtonDisplay.OnRight numerictxtbox.SpinButtons.DefaultTriangleImages = DefaultTriangleImages.Largest numerictxtbox.ToolTip = Me.ToolTip numerictxtbox.HorizontalAlign = HorizontalAlign.Left If lookupds IsNot Nothing Then If TypeOf lookupds Is IEnumerable Then Dim currentRow As IEnumerator = DirectCast(lookupds, IEnumerable).GetEnumerator If currentRow.MoveNext Then ' set the selected value Dim itemtext As String = System.Web.UI.DataBinder.GetPropertyValue(currentRow.Current, DataValueField) If Not String.IsNullOrEmpty(itemtext) Then numerictxtbox.Text = itemtext End If End If End If End If End Sub ''' <summary> ''' Sets up the date drop down for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupDateDropDown(ByVal lookupds As Object) Controls.Add(datedropdown) datedropdown.ID = "DateDropDown" datedropdown.EnableViewState = True ctlLabel.AssociatedControlID = datedropdown.ID 'datedropdown.NullText = String.Empty 'datedropdown.Nullable = True 'datedropdown.DataMode = Infragistics.Web.UI.EditorControls.DateDataMode.DateOrNull If lookupds IsNot Nothing Then If TypeOf lookupds Is IEnumerable Then Dim currentRow As IEnumerator = DirectCast(lookupds, IEnumerable).GetEnumerator If currentRow.MoveNext Then ' set the selected value Dim itemtext As String = System.Web.UI.DataBinder.GetPropertyValue(currentRow.Current, DataValueField) If Not String.IsNullOrEmpty(itemtext) Then datedropdown.Value = Convert.ToDateTime(itemtext) End If End If End If End If End Sub ''' <summary> ''' Sets up the true false radio buttons for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupRadioButtons(ByVal lookupds As Object) Controls.Add(trueRadioBtn) Controls.Add(GetBreakLiteral()) Controls.Add(falseRadioBtn) trueRadioBtn.ID = "TrueRadioButton" falseRadioBtn.ID = "FalseRadioButon" trueRadioBtn.GroupName = "RadioGroup" & Me.ID falseRadioBtn.GroupName = "RadioGroup" & Me.ID trueRadioBtn.Text = "Yes" falseRadioBtn.Text = "No" If lookupds IsNot Nothing Then If TypeOf lookupds Is IEnumerable Then Dim currentRow As IEnumerator = DirectCast(lookupds, IEnumerable).GetEnumerator If currentRow.MoveNext Then ' set the selected value Dim itemtext As String = System.Web.UI.DataBinder.GetPropertyValue(currentRow.Current, DataValueField) If Not String.IsNullOrEmpty(itemtext) Then trueRadioBtn.Checked = Convert.ToBoolean(itemtext) falseRadioBtn.Checked = Not Convert.ToBoolean(itemtext) End If End If End If End If End Sub ''' <summary> ''' Sets up the dropdown list for displaying ''' </summary> ''' <param name="lookupds">The datasource to use as a lookup</param> ''' <remarks></remarks> Private Sub SetupDropDownList(ByVal lookupds As Object) Controls.Add(dropdown) dropdown.ID = "DropList" ctlLabel.AssociatedControlID = dropdown.ID dropdown.DataTextField = Me.DataTextField dropdown.DataValueField = Me.DataItemValueField dropdown.DataSelectedField = Me.DataSelectedField dropdown.DataDefaultSelectedField = Me.DataDefaultSelectedField dropdown.DataTextBoxField = Me.DataTextBoxField dropdown.DataRequiresTextBoxField = Me.DataRequiresTextBoxField dropdown.TextMode = TextBoxMode.MultiLine dropdown.Rows = Me.Rows dropdown.ToolTip = Me.ToolTip dropdown.ProcessHtmlTags = NetsoftTextBox.HtmlTagOptions.EncodeTags If lookupds IsNot Nothing Then dropdown.DataSource = lookupds dropdown.DataBind() End If End Sub #End Region #Region " Overridden Methods " Protected Overrides Function CreateChildControls(ByVal dataSource As System.Collections.IEnumerable, ByVal dataBinding As Boolean) As Integer Dim itemcount As Integer = 0 If dataSource IsNot Nothing Then Controls.Add(ctlLabel) Controls.Add(GetBreakLiteral()) ctlLabel.ID = "ControlLabel" ctlLabel.Text = "label" If Not dataBinding Then Select Case Me.ItemType Case UDFTypes.CheckboxList SetupCheckBoxList(Nothing) Case UDFTypes.DateDropdown SetupDateDropDown(Nothing) Case UDFTypes.DropdownList SetupDropDownList(Nothing) Case UDFTypes.MultiLineTextBox SetupMultiLineTextBox(Nothing) Case UDFTypes.NumericTextBox SetupNumericTextBox(Nothing) Case UDFTypes.TextBox SetupTextBox(Nothing) Case UDFTypes.TrueFalseRadioButtons SetupRadioButtons(Nothing) End Select End If Dim e As IEnumerator = dataSource.GetEnumerator If e.MoveNext Then If dataBinding Then ' get the lookup datasource (it contains lookups as well as the answers) Dim lookupds As Object = Nothing If Not String.IsNullOrEmpty(DataLookupDatasourceField) Then lookupds = System.Web.UI.DataBinder.GetPropertyValue(e.Current, DataLookupDatasourceField) End If ' set the help text Dim helptext As String = System.Web.UI.DataBinder.GetPropertyValue(e.Current, Me.DataHelpTextField) If Not String.IsNullOrEmpty(helptext) Then Me.ToolTip = helptext End If Dim itemType As Object = Nothing If ViewState("DataTypeField") IsNot Nothing Then itemType = System.Web.UI.DataBinder.GetPropertyValue(e.Current, ViewState("DataTypeField")) End If If itemType IsNot Nothing Then ViewState("ItemType") = itemType Select Case itemType Case UDFTypes.CheckboxList SetupCheckBoxList(lookupds) Case UDFTypes.TextBox SetupTextBox(lookupds) Case UDFTypes.MultiLineTextBox SetupMultiLineTextBox(lookupds) Case UDFTypes.NumericTextBox SetupNumericTextBox(lookupds) Case UDFTypes.DateDropdown SetupDateDropDown(lookupds) Case UDFTypes.TrueFalseRadioButtons SetupRadioButtons(lookupds) Case UDFTypes.DropdownList SetupDropDownList(lookupds) End Select ' set the label text Dim labeltext As String = System.Web.UI.DataBinder.GetPropertyValue(e.Current, Me.DataLabelTextField) ctlLabel.Text = labeltext End If itemcount += 1 End If End If End If Return itemcount End Function #End Region #Region "Public Properties" ''' <summary> ''' The name of the field used to determine the datasource lookup for the child controls ''' </summary> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine the datasource lookup for the child controls")> _ Public Property DataLookupDatasourceField() As String Get If ViewState("DataLookupDatasourceField") Is Nothing Then Return String.Empty Else Return ViewState("DataLookupDatasourceField") End If End Get Set(ByVal value As String) ViewState("DataLookupDatasourceField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine the text displayed for each item ''' </summary> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine the type of control displayed for each item ")> _ Public Property DataTypeField() As String Get If ViewState("DataTypeField") Is Nothing Then Return String.Empty Else Return ViewState("DataTypeField") End If End Get Set(ByVal value As String) ViewState("DataTypeField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine whether the item is selected or not ''' </summary> ''' <value>The name of the selected field</value> ''' <returns>The name of the selected field</returns> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine whether the item is selected or not ")> _ Public Property DataSelectedField() As String Get If ViewState("DataSelectedField") Is Nothing Then Return String.Empty Else Return ViewState("DataSelectedField") End If End Get Set(ByVal value As String) ViewState("DataSelectedField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine the text displayed for each item ''' </summary> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine the text displayed for each item ")> _ Public Property DataTextField() As String Get If ViewState("DataTextField") Is Nothing Then Return String.Empty Else Return ViewState("DataTextField") End If End Get Set(ByVal value As String) ViewState("DataTextField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine the underlying value for each item ''' </summary> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine the underlying value for each item ")> _ Public Property DataValueField() As String Get If ViewState("DataValueField") Is Nothing Then Return String.Empty Else Return ViewState("DataValueField") End If End Get Set(ByVal value As String) ViewState("DataValueField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine the underlying value for each list item ''' </summary> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine the underlying value for each list item ")> _ Public Property DataItemValueField() As String Get If ViewState("DataItemValueField") Is Nothing Then Return String.Empty Else Return ViewState("DataItemValueField") End If End Get Set(ByVal value As String) ViewState("DataItemValueField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field used to determine whether the item requires the display of a textbox or not ''' </summary> ''' <value>The name of the field to determine whether the textbox is displayed</value> ''' <returns>The name of the field to determine whether the textbox is displayed</returns> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field used to determine whether the item requires the display of a textbox or not ")> _ Public Property DataRequiresTextBoxField() As String Get If ViewState("DataRequiresTextBoxField") Is Nothing Then Return String.Empty Else Return ViewState("DataRequiresTextBoxField") End If End Get Set(ByVal value As String) ViewState("DataRequiresTextBoxField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field containing the textbox text to bind to ''' </summary> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field containing the textbox text to bind to")> _ Public Property DataTextBoxField() As String Get If ViewState("DataTextBoxField") Is Nothing Then Return String.Empty Else Return ViewState("DataTextBoxField") End If End Get Set(ByVal value As String) ViewState("DataTextBoxField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field containing the textbox text to bind to ''' </summary> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field containing the label text to bind to")> _ Public Property DataLabelTextField() As String Get If ViewState("DataLabelTextField") Is Nothing Then Return String.Empty Else Return ViewState("DataLabelTextField") End If End Get Set(ByVal value As String) ViewState("DataLabelTextField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field containing the help text to bind to ''' </summary> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field containing the help text to bind to")> _ Public Property DataHelpTextField() As String Get If ViewState("DataHelpTextField") Is Nothing Then Return String.Empty Else Return ViewState("DataHelpTextField") End If End Get Set(ByVal value As String) ViewState("DataHelpTextField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' The name of the field determining the default selected field ''' </summary> ''' <remarks></remarks> <Category("Data"), DefaultValue(""), Description("The name of the field determining the default selected field")> _ Public Property DataDefaultSelectedField() As String Get If ViewState("DataDefaultSelectedField") Is Nothing Then Return String.Empty Else Return ViewState("DataDefaultSelectedField") End If End Get Set(ByVal value As String) ViewState("DataDefaultSelectedField") = value If MyBase.Initialized Then MyBase.RequiresDataBinding = True End If End Set End Property ''' <summary> ''' Number of Rows for the textbox when in multiline mode ''' </summary> <Category("Misc"), DefaultValue(""), Description("Number of Rows for the textbox when in multiline mode")> _ Public Property Rows() As Integer Get If ViewState("Rows") Is Nothing Then Return 0 Else Return ViewState("Rows") End If End Get Set(ByVal value As Integer) ViewState("Rows") = value End Set End Property ''' <summary> ''' Type of the userdefined control ''' </summary> <Category("Misc"), DefaultValue(""), Description("Type of the userdefined control")> _ Public ReadOnly Property ItemType() As UDFTypes Get If ViewState("ItemType") Is Nothing Then Return UDFTypes.None Else Return ViewState("ItemType") End If End Get End Property ''' <summary> ''' The value to return from the control ''' </summary> <Category("Misc"), DefaultValue(""), Description("The value to return from the control")> _ Public ReadOnly Property Value() As String Get Select Case ItemType Case UDFTypes.DateDropdown Return Me.datedropdown.Value Case UDFTypes.DropdownList Return Me.dropdown.SelectedValue Case UDFTypes.MultiLineTextBox Return Me.multilinetextbox.Text Case UDFTypes.NumericTextBox Return Me.numerictxtbox.Text Case UDFTypes.TextBox Return Me.txtbox.Text Case UDFTypes.TrueFalseRadioButtons If Me.trueRadioBtn.Checked Then Return True.ToString ElseIf Me.falseRadioBtn.Checked Then Return False.ToString Else Return String.Empty End If Case Else Return String.Empty End Select End Get End Property ''' <summary> ''' The value of the Explanation Box to return from the control ''' </summary> <Category("Misc"), DefaultValue(""), Description("The value of the Explanation Box to return from the control")> _ Public ReadOnly Property ExplanationValue() As String Get Select Case ItemType Case UDFTypes.DropdownList If Me.dropdown.RequiredTextBoxItems.Contains(Me.dropdown.SelectedIndex) Then Return Me.dropdown.TextBoxText Else Return String.Empty End If Case Else Return String.Empty End Select End Get End Property ''' <summary> ''' The Collection of items to return from the control ''' </summary> <Category("Misc"), DefaultValue(""), Description("The Collection of items to return from the control")> _ Public ReadOnly Property Items() As Collection(Of ExplanationItem) Get Select Case ItemType Case UDFTypes.DropdownList Return dropdown.ExplanationItems Case UDFTypes.CheckboxList Return chklist.Items Case Else Return Nothing End Select End Get End Property #End Region #Region " CSS Properties " ''' <summary> ''' The Name of the CSS Class used by the explanation Label ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the explanation label")> _ Public Property ExplanationLabelCssClass() As String Get Return Me.chklist.LabelCssClass End Get Set(ByVal value As String) Me.chklist.LabelCssClass = value Me.dropdown.LabelCssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the explanation textbox ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the explanation textbox")> _ Public Property ExplanationTextBoxCssClass() As String Get Return Me.chklist.TextBoxCssClass End Get Set(ByVal value As String) Me.chklist.TextBoxCssClass = value Me.dropdown.TextBoxCssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the dropdownlist ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the dropdownlist")> _ Public Property DropDownListCssClass() As String Get Return Me.dropdown.DropDownListCssClass End Get Set(ByVal value As String) Me.dropdown.DropDownListCssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the checkboxlist ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the checkboxlist")> _ Public Property CheckBoxCssClass() As String Get Return Me.chklist.CheckBoxCssClass End Get Set(ByVal value As String) Me.chklist.CheckBoxCssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the checkboxlist or dropdownlist validators ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the checkboxlist or dropdownlist validators")> _ Public Property ValidatorCssClass() As String Get Return Me.chklist.ValidatorCssClass End Get Set(ByVal value As String) Me.chklist.ValidatorCssClass = value Me.dropdown.ValidatorCssClass = value End Set End Property ''' <summary> ''' The Image used by the checkboxlist or dropdownlist validators ''' </summary> <Category("Appearance"), DefaultValue(""), Description("The image used by the checkboxlist or dropdownlist validators")> _ Public Property ValidatorImageUrl() As String Get Return Me.chklist.ValidatorImageUrl End Get Set(ByVal value As String) Me.chklist.ValidatorImageUrl = value Me.dropdown.ValidatorImageUrl = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the Label ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the label")> _ Public Property LabelCssClass() As String Get Return Me.ctlLabel.CssClass End Get Set(ByVal value As String) Me.ctlLabel.CssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the single line textbox ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the single line textbox")> _ Public Property TextBoxCssClass() As String Get Return Me.txtbox.CssClass End Get Set(ByVal value As String) Me.txtbox.CssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the multi line textbox ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the multi line textbox")> _ Public Property MultiLineTextBoxCssClass() As String Get Return Me.multilinetextbox.CssClass End Get Set(ByVal value As String) Me.multilinetextbox.CssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the numeric line textbox ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the numeric textbox")> _ Public Property NumericTextBoxCssClass() As String Get Return Me.numerictxtbox.CssClass End Get Set(ByVal value As String) Me.numerictxtbox.CssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the radio buttons ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the radio buttons")> _ Public Property RadioButtonCssClass() As String Get Return Me.trueRadioBtn.CssClass End Get Set(ByVal value As String) Me.trueRadioBtn.CssClass = value Me.falseRadioBtn.CssClass = value End Set End Property ''' <summary> ''' The Name of the CSS Class used by the date dropdown ''' </summary> ''' <value>The Name of the CSS Class</value> ''' <returns>The Name of the CSS Class</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the CSS Class used by the date dropdown")> _ Public Property DateDropDownCssClass() As String Get Return Me.datedropdown.CssClass End Get Set(ByVal value As String) Me.datedropdown.CssClass = value End Set End Property ''' <summary> ''' The name of the javascript function used to initialize the date dropdown ''' </summary> ''' <value>The name of the javascript function</value> ''' <returns>The name of the javascript function</returns> ''' <remarks></remarks> <Category("Appearance"), DefaultValue(""), Description("The name of the javascript function used to initialize the date dropdown")> _ Public Property DateDropDownClientSideInitialize() As String Get 'Return Me.datedropdown.ClientSideEvents.Initialize Return String.Empty End Get Set(ByVal value As String) 'Me.datedropdown.ClientSideEvents.Initialize = value End Set End Property #End Region End Class
The biggest points of interest are probably the CreateChildControls and SetupDateDropDown functions, and the Value property is where the value is being pulled back out. If I comment out the webdatepicker declarations and uncomment the webdatechooser declarations, the control works without an issue so it has to be something with the webdatepicker for me. Let me know your thoughts and if you want me to send anything else to help troubleshoot.
Thanks.