|
-
Oct 19th, 2005, 09:06 PM
#1
Thread Starter
Hyperactive Member
Forms Authentication Problem?
Hi,
I have conducted a search on the forum just to see if anybody else has experienced this problem and i couldn't find any similar posts. Here goes. I have set up a basic Forms autheentication. See below:
Code:
private void Button1_Click(object sender, System.EventArgs e)
{
if (txtUsername.Text == "????" && txtPassword.Text == "?????")
{
FormsAuthentication.RedirectFromLoginPage("LoggedIn", false);
}
else
{
lblLoggedin.Text = "Login falied";
}
}
The web.config file:
Code:
<configuration>
<system.web>
<customErrors mode="Off"/>
<authentication mode="Forms" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
</configuration>
Now this all works on my localhost, however as soon as i upload my webconfig file onto my webserver i get the following error:
Code:
RUNTIME ERROR
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
I am totally stumped to whats wrong here?
As always any help is greatly appreciated.
-
Oct 20th, 2005, 12:07 PM
#2
Re: Forms Authentication Problem?
On the target Web folder, has your application's folder been CREATEd in IIS as a virtual application??
Does it work if you load the pages to the highest level (root) folder of the Web server and run them from there? (not in their own subfolder)
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
-
Oct 20th, 2005, 03:31 PM
#3
Thread Starter
Hyperactive Member
Re: Forms Authentication Problem?
Lord_Rat, thanks for your suggestion. I put all the pages in the root as you suggested and it works, why is this? For future projects, how would i get it to work should i put the pages in a subfolder?
Thanks!!!
-
Oct 20th, 2005, 03:38 PM
#4
Re: Forms Authentication Problem?
Because every dot-net app needs to reside (as its base) in the highest folder that was CREATEd as a IIS application. The root automatically is, the rest has to be done by hand.
Speak with your Web host on this one.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|