Question

I'm working on my first asp webpage written in c# and asp.net, im having a problem with connecting all the links together. Basically whats happening is all the pages are linked together, however navigating between them doesnt always work.

For example the first page is login if the user logs in it takes them to default, if the user presses register on the login page it should take them to the register page (instead it doesnt, it changes the url to this

http://localhost:4902/login.aspx?ReturnUrl=%2fRegistration.aspx

and i cant get it to work from there.)

if the user then logs in while the url is like that, it will take them to the registration page... If the user does log in and decides to log out the url changes again, this time to this

http://localhost:4902/login.aspx?ReturnUrl=%2fDefault.aspx 

and i then cant access the register page unless i log in..

How do you go about fixing this?

I've tried using

response.redirect("url"); 

on the click event of the registration link and the loggedin event of the login control, however this issue this tend to still arise when it comes to logging out.,

Was it helpful?

Solution

Sounds like you need to allow anonymous access to your registration page. To do that, in your web.config file, just before the closing </configuration>, add this:

<location path="Registration.aspx">
    <system.web>
        <authorization>
            <allow users="?" />
        </authorization>
    </system.web>
</location>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top