Login control problem

I have a problem with the login control. I have three pages called login, secret and registered. I pinned my secret page using the login control and if I request my secret page it will redirect me to the login page which is ok to me.but the problem is if from here I click on the repository link it is not directed to registration page until I close the correct name enrty.if to fill in the correct login / password, it will direct me to the secret page. go back to the login page and now click on the registration link so it now changes to the register.thts page.

I used createtext and createtexturl property login control.please help me in this regard ...

I have the following code in my web config file.

<roleManager enabled="true"/>
  <authentication mode="Forms"/>
    <authorization>
      <deny users="?"/>
    </authorization>

      

and following in the original file ......

<asp:Login ID="Login1" runat="server" 
  DestinationPageUrl="~/Secret.aspx" 
  CreateUserText="New User Register" 
  CreateUserUrl="~/register.aspx" 
  FailureText="You are not registered.....try agian.." />

      

0


a source to share


3 answers


It looks like you have not only "protected" your secret page, but also your registration page.

The code you entered in the question is not showing (you have to select the code and click the 0 and 1 button), but try adding something like this to the config section of your web.config.



<location path="register.aspx">
    <system.web>
        <authorization>
            <allow users="*" />
        </authorization>
    </system.web>
</location>

      

+1


a source


Amit,

To check if the issue is related to your authorization setting, you can temporarily try the following:



<authorization>
<allow users="*" />
</authorization> 

      

If after this check everything works, then it is <location path="register.aspx">

correct - is it in a subfolder?

0


a source


Hmm, now that we can see the code, we have a better chance of helping you;)

You didn't say that much, but I'm assuming you have all three files - login, registration and secret in the same folder?

If so, what are you talking about with this:

<authorization>
  <deny users="?"/>
</authorization>

      

Is "Deny all anonymous users access to these pages" - and this overrides the "Allow all users" option proposed by Janzi.

Try the following:

//Folder structure
web.config - Root Web.config
Login.aspx - login page
Register.aspx - registration page
/Secret - Folder called "Secret"
/web.config - web.config in "Secret"
/Secret.aspx - secret pages

      

The web.config in the / Secret folder should contain:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <system.web>
        <authorization>
            <deny users="?" />
        </authorization>
    </system.web>
</configuration>

      

While your root web.config defines the membership provider, defines options for auth forms, etc.

Alternatively, you can delete the web.config file in / Secret and just use the location element in the root web.config:

<location path="Secret">
  <system.web>
    <authorization>
      <deny users="?" />
    </authorization>
  </system.web>
</location>

      

0


a source







All Articles