【问题标题】:why Context.RewritePath method not work on iis为什么 Context.RewritePath 方法不适用于 iis
【发布时间】:2011-12-28 06:40:29
【问题描述】:

我有一个 asp.net3.5 网站。想在 iis 上部署这个网站。部署后我的默认页面无法重定向到另一个页面。需要帮助了解为什么页面不重定向 我的默认页面是

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

<script runat="server">
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs)
        Response.Write("hello")
      Context.RewritePath("~/asp/Default.aspx", False)


    End Sub
</script>

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

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

需要帮助,为什么 Context.RewritePath 这个方法不起作用。我的服务器版本是 windows server 2008 r2,iis-7.0,网站在 3.5 上开发

如果有任何疑问请询问,谢谢。

【问题讨论】:

    标签: asp.net iis deployment iis-7


    【解决方案1】:

    这需要在 globals.acsx 页面的 begin_request 下

    【讨论】:

      猜你喜欢
      • 2020-09-25
      • 2015-11-24
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多