0

I am using Asp.NET Forms authentication for my project. When the authentication cookie expires, Forms authentication redirects to loginUrl, and appends ReturnUrl parameter in query string.

Eg http://localhost:1234/Default.aspx?ReturnUrl=/blabla

Now, I want to add a parameter Id, to this url, such as:

http://localhost:1234/Default.aspx?ReturnUrl=/blabla&Id=123

Where the value for Id should be fetched from code behind.

I checked this, but it doesn't solve my problem.

1 Answer 1

0

FormsAuthentication simply redirects to the login page with a ReturnUrl parameter value of whatever the last request was. I'm not sure what '..it doesn't solve my problem' means, but the article you link to, for creating an Http Module, seems to be your best bet. In other words, you'll have to put some custom code between the detection of the user not being authenticated and the redirect to the login page. The clean ways to do this are described in that article.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.