本文介绍了UpdatePanel DropDownList.SelectedIndexChanged事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在UpdatePanel中使用了DropDownList,并且已经处理了SelectedIndexChanged,并且它已成功触发,但是由于无法获取正确的SelectedValue,为什么..?
这是我的代码
I have used a DropDownList in UpdatePanel and i have handled SelectedIndexChanged and it is firing successfully, but in that i unable to get Correct SelectedValue, why..?
Here is my code
<asp:UpdatePanel ID="NetworkUpadated" UpdateMode="Conditional" runat="server">
<ContentTemplate>
NMI: <asp:TextBox ID="NMITextBox" OnTextChanged="GetNetwork" AutoPostBack="true" runat="server"></asp:TextBox>
Network Code: <asp:DropDownList ID="NetworkCodeDropDown" AutoPostBack="true" OnSelectedIndexChanged="NetworkCodeDropDown_Changed" runat="server" > </asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>
并在我后面的代码中
and in my code behind
public void NetworkCodeDropDown_Changed(object sender, EventArgs e)
{
string sel = NetworkCodeDropDown.SelectedValue;// it showing always 1
}
如果我在Fidler中检查了请求,它将是正确的选定值,
但是为什么我无法在代码中获取我选择的值..
请帮助我
If i check the request in Fidler it is going correct selected value,
but why i unable to get my selected value in code behind..
please help me
推荐答案
这篇关于UpdatePanel DropDownList.SelectedIndexChanged事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!