문제

My web application immediately redirects users to a login page via web.config. How can I get the url that requested my page? I tried using the Request paramaters in Page_Load of the Login.aspx page but that didn't work.

도움이 되었습니까?

해결책 2

I found the answer to what I was looking for by using UrlReferrer. See below.

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    If Request.UrlReferrer.ToString <> "" Then
        Session("PageUrl") = Request.UrlReferrer.ToString
    End If
 End Sub

다른 팁

I don´t understand completely what do you mean with

"how can I get the url requested my page"

you may have the case to set your page as public or cange the login url to the page you need

<authentication mode="Forms">
  <forms loginUrl="your_page.aspx"
    defaultUrl="index.aspx" />
</authentication>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top