重定向到违约。aspx代替“xxx。使用登录控件登录应用程序后的aspx。

时间:2022-10-20 08:25:30

Thanks for going to answer my question. I have the folowing pages.

谢谢你回答我的问题。我有折叠页。

  • login.aspx
  • . aspx
  • default.aspx
  • default . aspx
  • xxx.aspx
  • xxx.aspx

After logging into application default.aspx will be displayed. Now if the user is trying to open http://server/xxx.aspx?Id=1234 by specifying its URL directly in a browser, the login screen is displayed and after successfull login, system redirects to "default.aspx" and not to "http://server/xxx.aspx?Id=1234". Actually there is an external application that would call my system like that. So Please let me know why is this happening. The .Net login control is used to login into the application. Kindly help me to solve this issue.

在登录到应用程序默认后。aspx将显示出来。现在,如果用户试图打开http://server/xxx.aspx?Id=1234通过在浏览器中直接指定URL,显示登录界面,成功登录后,系统重定向到“default”。而不是“http://server/xxx.aspx?Id=1234”。实际上有一个外部应用程序可以像这样调用我的系统。所以请告诉我为什么会这样。. net登录控件用于登录应用程序。请帮助我解决这个问题。

Thanks,
Ang Vin

谢谢,和Vin

3 个解决方案

#1


2  

Are you using Forms Authentication or doing this directly in the application? If you do something like this in your web.config it will handle all the redirecting for you.

您是在应用程序中使用表单身份验证还是直接使用表单身份验证?如果你在你的网站上做这样的事情。配置它将为您处理所有重定向。

<authentication mode="Forms">
            <forms name="FwLoginCookie" loginUrl="Login.aspx"
        protection="All" 
        path="/" >
            </forms>
        </authentication>
        <authorization>
            <deny users="?"/>
        </authorization>

Is there anything in the URL stating the ReturnURL? With the above setting if the user tries to go to xxx.aspx I would expect the URL of the login dialog to look like "Login.aspx?ReturnUrl=xxx.aspx"

URL中是否有声明ReturnURL的内容?如果用户试图访问xxx,则使用上述设置。我希望登录对话框的URL看起来像“login .aspx?ReturnUrl=xxx.aspx”。

#2


1  

Check that you are NOT setting the DestinationPageUrl property in the login control:

检查您没有在登录控件中设置DestinationPageUrl属性:

<asp:Login 
  ID="Login1" 
  runat="server" 
  DestinationPageUrl="~/Default.aspx">
</asp:Login>

I assume you have as this property overrides the default behaviour you are actually looking for.

我假设当这个属性覆盖了你正在寻找的默认行为。

#3


0  

Response.Redirect(Request.UrlReferrer.ToString());

#1


2  

Are you using Forms Authentication or doing this directly in the application? If you do something like this in your web.config it will handle all the redirecting for you.

您是在应用程序中使用表单身份验证还是直接使用表单身份验证?如果你在你的网站上做这样的事情。配置它将为您处理所有重定向。

<authentication mode="Forms">
            <forms name="FwLoginCookie" loginUrl="Login.aspx"
        protection="All" 
        path="/" >
            </forms>
        </authentication>
        <authorization>
            <deny users="?"/>
        </authorization>

Is there anything in the URL stating the ReturnURL? With the above setting if the user tries to go to xxx.aspx I would expect the URL of the login dialog to look like "Login.aspx?ReturnUrl=xxx.aspx"

URL中是否有声明ReturnURL的内容?如果用户试图访问xxx,则使用上述设置。我希望登录对话框的URL看起来像“login .aspx?ReturnUrl=xxx.aspx”。

#2


1  

Check that you are NOT setting the DestinationPageUrl property in the login control:

检查您没有在登录控件中设置DestinationPageUrl属性:

<asp:Login 
  ID="Login1" 
  runat="server" 
  DestinationPageUrl="~/Default.aspx">
</asp:Login>

I assume you have as this property overrides the default behaviour you are actually looking for.

我假设当这个属性覆盖了你正在寻找的默认行为。

#3


0  

Response.Redirect(Request.UrlReferrer.ToString());