I have created a custom web part called test and added a drop down to the test.ascx file like this:
<asp:DropDownList ID="drpClass" runat="server" OnSelectedIndexChanged="drpClass_Change" />
I have also tried to do it this way:
<cms:LocalizedDropDownList ID="drpClass" runat="server" />
In the test.ascx file I also have the following code:
<cms:LocalizedButton ID="btnOK" Text="Rename Class" runat="server" CssClass="SubmitButton" OnClick="btnOK_Click" EnableViewState="false" />
In the test.ascx.cs file I have the following code:
protected void btnOK_Click(object sender, EventArgs e)
{
int classID = int.Parse(drpClass.SelectedValue);
}
there are four values in the drop down box 1,2,3 and 4.
When I run this in debug mode the value of classID always become the first value of the drop down box (1) even if I have picked a different value (2,3 or 4).
Is there any additional code I need to add to my web part to enable the change even for the drop down control?