ASP.NET 2.0中的跨页发布
大家好,
我有page1.aspx,单击此按钮时有一个按钮,我正在打开另一个page2.aspx
用户在其中选择一些asp:linkbutton,我必须将此信息发送回page1.aspx
并将执行进一步的逻辑
我正在使用跨页后退
1.使用page1.aspx作为上一页,并将page2.aspx作为源页面
2.单击保存页面2.aspx被打开,用户选择asp:linkbutton
3.页面被交叉发布回page1.aspx
但是这里的IsCrossPagePostBack总是错误的.
跨页过帐只是fwd吗?
建议一些解决方案
Hi All,
I have page1.aspx with a button on click of this buttion i am opening another page2.aspx
where user selects some asp:linkbutton and i have to send back this info to the page1.aspx
and further logic will be executed
i am using cross page back
1. with page1.aspx as previouspage and page2.aspx as source page
2. on click of save page2.aspx got opened and user selects asp:linkbutton
3. the page got cross posted back to page1.aspx
but here always the IsCrossPagePostBack is always false.
cross page posting is only fwd?
suggest some solution
也许在这里看看
http://www.alexthissen.nl/blogs/main/archive/2006/09/13/beware-the-iscrosspagepostback-property.aspx [
Maybe have a look here
http://www.alexthissen.nl/blogs/main/archive/2006/09/13/beware-the-iscrosspagepostback-property.aspx[^]
If you evaluate the IsCrossPagePostback like so:
if (this.Page.IsCrossPagePostback)
即使您确定它是正确的,您也总是会得到错误的信息.相反,您应该像这样检查属性:
you will always get false, even if you are sure that it should be true. Instead, you should check the property like this:
if (this.Page.PreviousPage != null &&
this.Page.PreviousPage.IsCrossPagePostback)