Hello. I have a form with two drop down lists, one to select a month and another to select a year. However, I cannot get them to drop down so the user can make a selection. I have checked to make sure they are enabled and that they have items. What could be causing this? The other fields on the form (text boxes and buttons) work just fine.
Here is a snippet from my aspx file:
<div class="row">
<label class="col-md-3 text-right"><span class="required">*</span> Expiration Date</label>
<div class="col-sm-9">
<Telerik:RadDropDownList ID="ddlMonth" DefaultMessage="Month" CssClass="form-control forgotten_txt" runat="server" Width="135px" DropDownHeight="200px" DropDownWidth="135px"></Telerik:RadDropDownList>
<asp:RequiredFieldValidator runat="server" ControlToValidate="ddlMonth" CssClass="alert-warning" ErrorMessage="(Required)" ValidationGroup="paymentprofile"></asp:RequiredFieldValidator>
<Telerik:RadDropDownList ID="ddlYear" DefaultMessage="Year" CssClass="form-control forgotten_txt" runat="server" Width="135px" DropDownHeight="200" DropDownWidth="135"></Telerik:RadDropDownList>
<asp:RequiredFieldValidator runat="server" ControlToValidate="ddlYear" CssClass="alert-warning" ErrorMessage="(Required)" ValidationGroup="paymentprofile"></asp:RequiredFieldValidator>
<asp:Label ID="lblErrorMessage" runat="server" CssClass="alert-warning"></asp:Label>
</div>
</div>
In the code behind during page load, the following routine populates the month drop down list. A similar routine is used for the year list.
Sub bindMonthDropdownlist()
Dim item As DropDownListItem
For month As Integer = 1 To 12
item = New DropDownListItem()
Dim monthName As String = Globalization.DateTimeFormatInfo.CurrentInfo.GetMonthName(month)
item.Text = month.ToString("00") & " " & monthName
item.Value = If(month < 10, "0" + month.ToString(), month.ToString())
ddlMonth.Items.Add(item)
Next
End Sub
The form is in a <div> that is initially hidden (visible="false"). I don't think that should make any difference, but I thought I should mention it.
I have tried removing the required field validator, populating the drop box lists using a table, but nothing seems to work.
Any suggestions would be greatly appreciated.