I am trying to get the selected value from dropdownlist which is open in jquery dialog. This is the code I have.
<div id="add_new_user" class="dialog-content table-options-modal large-label-form" title="User Access">
<div class="form-inline form-wrapper">
<div class="modal-body">
<div class="col-sm-6">
<div class="large-label form-group">
<asp:DropDownList runat="server" ID="drpUserType">
<asp:listitem text="--Select--" value="0" />
<asp:listitem text="aaa" value="1" />
<asp:listitem text="bbb" value="2" />
</asp:DropDownList>
</div>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="btnSave" class="btn btn-gray btn-fixed" runat="server" OnClick="btnSave_Click" Text="Save"></asp:Button>
</div>
</div>
</div>
Code behind :
protected void btnSave_Click(object sender, EventArgs e)
{
int drpValue = drpUserType.SelectedValue.ToInt();
}
The problem is, every time I got '0' value. Thank you.