FormsAuthentication.RedirectFromLoginPage重新加载页面加载、页面、FormsAuthentication、RedirectFromLoginPage

2023-09-07 00:37:46 作者:南巷烈酒独饮悲

我使用的净memebership制度,uptil现在我还没有与任何真正的麻烦。 我现在有一个重叠的地方,用户可以创建一个配置文件。当创建配置文件我只是想重定向到同一页面,而不是默认页或返回URL - 不存在

I am using the .Net memebership system, and uptil now I haven't had any real troubles with it. I now have a overlay where a user can create a profile. When the profile is created I just want to redirect to the same page, and not to the default page or the return url - which doesn't exists.

我试图阻止FormsAuthentication.RedirectFromLoginPage反应,但没有效果:

I have tried to stop the FormsAuthentication.RedirectFromLoginPage response, but with no effect:

 FormsAuthentication.RedirectFromLoginPage(username, false);
 // End the redirect so it doesnt redirect to default url (front-page)
 Response.End();
 Response.Redirect(Request.RawUrl);

有没有人有一个想法,这可怎么解决呢?

Does anyone have an idea to how this can be solved?

推荐答案

而不是使用这样的:

FormsAuthentication.SetAuthCookie(username, false);
Response.Redirect(Request.RawUrl);