回复不在aspx页面中工作 [英] Post Back not working in aspx page
本文介绍了回复不在aspx页面中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我是.Net的新手。我遇到了一个问题。我正在使用从Visual Studio 2010中的母版页继承的aspx页面。我发现PostBack不适用于LinkButton click事件& DropDownList indexChanged。虽然普通的Button& ImageButton工作正常。请帮我看DropDownList& LinkButton将工作......
这是我的完整代码。
Hi All,
I'm new in .Net. I've a faced a problem. I'm using an aspx page that is inherited from master page in Visual Studio 2010. I've found that PostBack is not working for LinkButton click event & DropDownList indexChanged. Though normal Button & ImageButton is working fine. Please help me how DropDownList & LinkButton will work...
Here is my full code.
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_Body" runat="server">
<asp:DropDownList ID="ddlPageSelector" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPageSelector_SelectedIndexChanged">
</asp:DropDownList>
</asp:Content>
protected void ddlPageSelector_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Write(ddlPageSelector.SelectedValue);
}
但是相同的代码在VisualStudio 2008中有效。
请帮帮我。 ..
But same code is working in VisualStudio 2008.
Please help me out ...
推荐答案
从代码中看来你的ASPX页面正试图找到一个名为 ddlPageSelector_SelectedIndexChanged 的事件处理程序,而你的代码是< b> DropDownList1_SelectedIndexChanged 。
我建议你重建解决方案,如果处理程序不存在,应该抛出错误。
From the code it seems that your ASPX page is trying to find an event handler named ddlPageSelector_SelectedIndexChanged while your code behind is DropDownList1_SelectedIndexChanged.
I would suggest you to rebuild the solution and that should throw an error if the handler does not exist.
这篇关于回复不在aspx页面中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文