0

I have been trying to set the default url but it is not redirecting to the page that I want. The defaultUrl="admin/Home.aspx" is keeping redirecting back to the login.aspx can someone please help?

Below is the code i am doing in the web.config

<authentication mode="Forms">
      <forms loginUrl="~/Login.aspx" timeout="20" defaultUrl="admin/Home.aspx" />
</authentication>

the url after being redirected is as follows

/Login.aspx?ReturnUrl=%2fadmin%2fHome.aspx

what do the %2f mean?

Thanks

2 Answers 2

3

From what I can see it's redirecting you back to the login page because your not authenticated? I maybe wrong on that though.

The %2f is an url encoded forward slash.

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

Comments

0

The WebConfigurationManager is the class you want to look at.

It doesn't specifically address the web.config tag you are trying to edit which is:

<forms loginUri="http://website.com/login.aspx" /> 

But as long as there are no restrictions on that tag this should solve your problems.

Here is the docs.

http://msdn.microsoft.com/en-us/library/system.web.configuration.webconfigurationmanager.aspx

1 Comment

i have another web.config file which includes <location path="SearchPage.aspx"> <system.web> <authorization> <allow roles="1, 2, 3"/> <deny users="*"/> </authorization> </system.web> </location>

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.