如何在ASP.net中的许多以前的页面之间进行区分 [英] How to differentiate among many previous pages in ASP.net

查看:57
本文介绍了如何在ASP.net中的许多以前的页面之间进行区分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有问题,
在我的Web项目中,我可以从多个页面转到特定页面.
当我转到特定页面时,我想知道上一页的名称是什么

因为我在特定页面内有某些代码,仅在上一页为主页时才要执行.

我想写这样的代码:

Hi every body,

I have problem that,
in my web project that i can go to specific page from many page.
I want to know what is the name of the previous page when i go to the specific page

Because i have certain code inside the specific page that i want to execute only when the previous page is home page.

I want to write code like that:

if (PreviousPage == "HomePage.aspx")
        {
            // certain code goes here
        }
        else if(PreviousPage == "SpecificPage.aspx")
        {
            // certain code goes here
        }



希望您能每次都帮助我;)
谢谢



I hope you help me please like every time ;)
Thanks

推荐答案

我猜你在找"Request.UrlReferrer.AbsoluteUri"

博客文章: http://codebetter.com/blogs/peter. van.ooijen/archive/2005/07/19/129384.aspx [
I guess you are looking for "Request.UrlReferrer.AbsoluteUri"

A blog post: http://codebetter.com/blogs/peter.van.ooijen/archive/2005/07/19/129384.aspx[^]


这篇关于如何在ASP.net中的许多以前的页面之间进行区分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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