1

我的应用程序的 global.asax 文件中有一些代码。每次我调试我的网站时,我都会sqlexception因为某种原因得到一个:

void Application_AuthorizeRequest(object sender, EventArgs e)
{
    if (Membership.GetUser() != null && Roles.IsUserInRole("UnFilled")) // this is where I get the exception
    {
        if (Response.Cookies["Expiration"] == null)
        {
            HttpRequest request = Context.Request;
            HttpResponse response = Context.Response;
            response.ContentType = ".aspx";
            response.Write(request.Url.Host + "/Activate.aspx?account="+Membership.GetUser().Email);  
        }
    }      
}

有谁知道我为什么会得到这个,我该如何解决?

4

1 回答 1

0

我找到了答案,但不确定它为什么有效。如果我将编码放入自定义 http 处理程序中,它似乎可以工作。

感谢所有的贡献。

于 2012-09-08T03:51:22.033 回答