【发布时间】:2011-10-16 10:37:00
【问题描述】:
我有用户 global.asax,我已经在我的 ASP.NET 应用程序中编写了这段代码:
<%@ Application CodeBehind="Global.asax.cs" Language="C#" %>
<script RunAt="server">
public void Application_Start()
{
string str = Context.Request.Url.AbsoluteUri.Replace("http", "https");
Context.RewritePath(str);
}
</script>
但它给了我这个:
"Request is not available in this context"
【问题讨论】:
-
请看这个问题的答案:stackoverflow.com/questions/1790457/…
标签: asp.net global-asax