T
Tony Johansson
I fill a dropdownlist in this way
<aspropDownList id="DropdownOrderStatus" runat="Server">
<asp:ListItem>Submitted</asp:ListItem>
<asp:ListItem>Processed </asp:ListItem>
</aspropDownList>
and I have an enum that looks like this
public enum orderStatusType {Created, Submitted,Processed};
I fetch the control DropDownList in this way
DropDownList ddl =
(DropDownList)DetailsView1.FindControl("dropDownOrderStatus");
I get the text value in this way.
string text = ddl.Text; // So here it says Submitted
Now what I want is to convert the string value Submitted to integer 1
because Submitted is in position 2 in the enum
How can I do that ?
//Tony
<aspropDownList id="DropdownOrderStatus" runat="Server">
<asp:ListItem>Submitted</asp:ListItem>
<asp:ListItem>Processed </asp:ListItem>
</aspropDownList>
and I have an enum that looks like this
public enum orderStatusType {Created, Submitted,Processed};
I fetch the control DropDownList in this way
DropDownList ddl =
(DropDownList)DetailsView1.FindControl("dropDownOrderStatus");
I get the text value in this way.
string text = ddl.Text; // So here it says Submitted
Now what I want is to convert the string value Submitted to integer 1
because Submitted is in position 2 in the enum
How can I do that ?
//Tony