webform password protected page

F

fred

Hi all,
I am new for using C# to develop web app.
I made a web project which was password protected by using form mode
authentication.
in my login page ,I added one button of "add a user" which linked the
page to add a user to database. I confronted one problem.
now whenever a user click "add a user" button, it won't go to the
linker,it always stay in the login page. I guess it is my web config
problem which always try to authenticate my role.
anybody there has idea about this web config?
thanks
 
S

Steven Nagy

What else is on the same page?
In the properties for your button, set the validation property to
false (can't remember exactly what its called, look for one in designer
mode with something like "causesValidation" or similar)..If you have
any validators on your page, by default a button will ensure that the
validation is completed before it redirects. Setting this property to
false tells the button that the form doesn't need to be valid to
redirect.

Post some code for your button as well if this isn't the problem you
are facing.
 
F

fred

Thanks Steven,
I did set causesValidation false.
this is my code
*********
//"add a user" button
protected void BtnNew_Click(object sender, EventArgs e)
{
//AddAccount.aspx is registration page.
Response.Redirect("AddAccount.aspx");
}
*********


This is my snippet of web.config
**************
<authentication mode="Forms">
<forms loginUrl="login.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
**************
 
S

Steven Nagy

Hmm, not my specialty to be honest, but I bet you can create
"exceptions" for which pages don't need authorisation to run.
Sorry I can't help this time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top