获取上一页的名称 [英] Get name of previous page

查看:75
本文介绍了获取上一页的名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我在母版页上有一个图像按钮,该按钮将用户回传到另一个页面,并且我想获取实际单击它的页面的名称! Plz.帮助.......

在此先谢谢您!!!!!!!

Dear All,

I have a image button on master page which postbacks user to another page and i want to get the name of the page from which it was actually clicked!!!
Plz. help.......

Thanks in advance!!!!!!

推荐答案

PreviousPage仅在跨页回发后才有效.除此之外,ASP.NET不知道最后一页是什么,怎么可能?您了解ASP.NET和Internet的工作原理吗?他们是无国籍的.每个请求都是唯一的,而不是链的一部分.您可以通过以下方式创建链:在会话中存储最后一页的名称,并在再次存储之前对其进行检查(检查事件和页面加载,将其存储在页面预呈现中是一种很好的模式).但是,首先要问自己为什么要知道,整个设计是否有问题?
PreviousPage only works after a cross page postback. Beyond that, ASP.NET can''t know what the last page was, how could it ? Do you understand how ASP.NET and the internet works ? They are stateless. Each request is unique and not part of a chain. You can CREATE a chain, by storing the name of the last page in the session, and checking it before you store it again ( check in events and page load, store in page prerender is a good pattern ). But, ask yourself first why you need to know, is there something wrong with your design as a whole ?


您尝试过Page.PreviousPage吗?
http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx [ ^ ]

http://blogs.mgtechgroup.com/markc/存档/2007/05/03/Using-PreviousPage-with-Master-Pages.aspx [
Did you try Page.PreviousPage?
http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx[^]

http://blogs.mgtechgroup.com/markc/archive/2007/05/03/Using-PreviousPage-with-Master-Pages.aspx[^]


使用server.transfer方法.

http://msdn.microsoft.com/en-us/library/ms525800 [ ^ ]
Use server.transfer method.

http://msdn.microsoft.com/en-us/library/ms525800[^]


这篇关于获取上一页的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆