FormsAuthentication.RedirectFromLoginPage reload p

2019-08-17 08:46发布

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.

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?

1条回答
Luminary・发光体
2楼-- · 2019-08-17 09:21

Use this instead:

FormsAuthentication.SetAuthCookie(username, false);
Response.Redirect(Request.RawUrl);
查看更多
登录 后发表回答