Hi, I have a DropDownList with a list of value.
I need in my code USE the value selected by the User in the DropDownList AS INT DataType (numeric).
At the moment I am using this code below (CONVERTING DATATYOES). Script work just fine.
But I would like to know if exists an alternative way to do it.
I am pretty new in ASP.NET any ideas it is very appreciate. Thanks for your time.
<asp:DropDownList ID="uxPageSizeUsersSelector" runat="server"
AutoPostBack="True"
onselectedindexchanged="uxPageSizeUsersSelector_SelectedIndexChanged">
<asp:ListItem Value="1" Selected="True">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
</asp:DropDownList>
int myPageSize = Convert.ToInt16(uxPageSizeUsersSelector.SelectedValue.ToString());
PageSize = myPageSize;