当重定向到特定的.aspx页面中Request.UrlReferrer为null [英] Request.UrlReferrer is null when redirected to that particular .aspx page

查看:219
本文介绍了当重定向到特定的.aspx页面中Request.UrlReferrer为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

批准我想重定向到Admin_View_Customers.aspx页客户之后。为了这个目的我写了下面code。

After approve the customer I want to redirect to Admin_View_Customers.aspx page. For that purpose i wrote the following code.

ScriptManager.RegisterStartupScript(this, GetType(), "message", "alert('The selected user has been Approved successfully.');location.href = 'Admin_View_Customers.aspx';", true);

但在Admin_View_Customers.aspx的页面加载事件我已经写了一个code:

But in the page load event of Admin_View_Customers.aspx i have wrote a code :

if (Request.UrlReferrer == null)
            {
                Response.Redirect("AccessDenied.aspx");
            }

为了避免被复制网址并将其粘贴在其他浏览器或其他tab.My问题访问此页是我的选择的用户已成功批准的消息。 ,但它会被重定向到不AccessDenied.aspx到Admin_View_Customers.aspx。
我使用ASP.NET与C#
任何帮助将AP preciated

in order to avoid access to this page by copy the url and paste it in another browser or another tab.My problem is that I got the message The selected user has been Approved successfully. but it is redirected to AccessDenied.aspx NOT to the Admin_View_Customers.aspx. I am using ASP.NET with C# Any Help will be appreciated

推荐答案

Request.UrlReferrer只能用一个Hyperlink..not与重定向

Request.UrlReferrer can only be used with a Hyperlink..not with redirects

这篇关于当重定向到特定的.aspx页面中Request.UrlReferrer为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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