0

我有一个 ASP.NET 页面,我现在得到的是

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RedirectMeNow.aspx.cs" Inherits="abc.eyd._12.TEMPLATE.LAYOUTS.RedirectMeNow" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

    </div>
    </form>
</body>
</html>

我怎样才能将用户从他来自这里的地方重定向回来,而不是像这里这样的代码后面

从 ASP.NET 用户控件中的用户来源重定向回来

或者我只想要一个 ASP.NET 页面来重定向随叫随到的用户

4

1 回答 1

4

为避免使用代码隐藏,您必须使用客户端 Javascript 函数:

window.history.back();

您可以将其绑定到事件或在页面加载期间执行它。

编辑:如果您想将此页面设置为仅重定向页面,您可以将此代码添加到您的标签中:

<head>
....
<script type="text/javascript>
window.history.back();
</script>
</head>

它将在页面加载后立即执行。就是这样!

于 2012-11-15T13:00:45.667 回答