[thelist] .NET: drop down selected item
Casey Crookston
caseyc at IntelliSoftmn.com
Wed Mar 14 16:07:12 CDT 2007
>> We probably need to see the full select box markup.<<
In the .aspx file:
<asp:DropDownList id="drpSelectMonthTo" runat="server">
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
<asp:ListItem>5</asp:ListItem>
asp:ListItem>6</asp:ListItem>
<asp:ListItem>7</asp:ListItem>
<asp:ListItem>8</asp:ListItem>
<asp:ListItem>9</asp:ListItem>
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>11</asp:ListItem>
<asp:ListItem>12</asp:ListItem>
</asp:DropDownList>
In the code behind:
drpSelectMonthTo.SelectedValue = (intMonth).ToString
In the HTML Source:
<select name="Login_framework1:_ctl0:drpSelectMonthTo"
id="Login_framework1__ctl0_drpSelectMonthTo">
<option value="1">1</option>
<option value="2">2</option>
<option selected="selected" value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
More information about the thelist
mailing list