返回网址问题.(重定向到登录页面). [英] Return url issue.(Redirecting to Login Page).

查看:153
本文介绍了返回网址问题.(重定向到登录页面).的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,一旦成功登录,就会有一个名为charitycommitee.aspx的页面,其中显示注释,并且具有编辑按钮.

当我单击编辑"按钮时,编辑器打开,文本可通过更新按钮进行编辑".
单击更新"按钮将重定向到该URL:

http://ifintranet.imagefirst.net/Login.aspx?ReturnUrl=%2fCorporateCharities.aspx

我应该重定向到:
http://ifintranet.imagefirst.net/CorporateCharities.aspx
(带有更新的数据).

返回网址出现问题.

注意:我不在该页面的任何地方

请帮忙.

谢谢.

In my application once I have logged in successfully I have a page called as charitycommitee.aspx in which I show comments and it has an edit button.

When I click on the edit button the editor opens up and Text is Editable with update button.
Clicking on Update button redirects to this url:

http://ifintranet.imagefirst.net/Login.aspx?ReturnUrl=%2fCorporateCharities.aspx

I should be redirected to:
http://ifintranet.imagefirst.net/CorporateCharities.aspx
(with the updated Data).

Got some issue with the Return Url.

NOTE: I am not Directing anywhere in that Page

PLease Help Its Urgent.

Thank You.

推荐答案

如果使用自定义代码验证用户,请确保它实际上重定向到Returnurl(如果有效).

示例:
If you are using custom code to validate user, ensure that it actually redirects to the Returnurl, if it is valid.

Example:
if (Membership.ValidateUser(userName.Text, password.Text))
{
    if (Request.QueryString["ReturnUrl"] != null)
    {
        FormsAuthentication.RedirectFromLoginPage(userName.Text, false);
    }
    else
    {
        FormsAuthentication.SetAuthCookie(userName.Text, false);
    }
}
else
{
    Response.Write("Invalid UserID and Password");
}



如果这样做没有帮助,则必须检查您的代码.



If this doesn''t help, one would have to review your code.


这篇关于返回网址问题.(重定向到登录页面).的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆