Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 6th, 2004, 10:25 AM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default FormsAuthentication not declared!

Hi-
I am trying to use FormsAuthentication, but getting the error:-

"Name FormsAuthentication not declared".

Do I need to include anything in my code behind file. The code behind file has following statement:-

If ValidateUser(Me.txtLoginName.Text, Me.txtPassword.Text) = True Then
FormsAuthentication.RedirectFromLoginPage(Me.txtLo ginName.Text, False)
Else
Me.lblHelp.InnerText = "Login Failed. Please Try Again !"
End If

In my web.config file, I have the following code:-

<authentication mode="Forms">
<forms name=".ASPXAUTH"
loginUrl="login.aspx"
protection="All"
timeout="480"
path="/"
/>

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


 
Old October 6th, 2004, 10:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Did you inherit the System.Web.Security namespace?
 
Old October 6th, 2004, 10:29 AM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great!, That was it!

Thanks.







Similar Threads
Thread Thread Starter Forum Replies Last Post
FormsAuthentication swifty_programmer ASP.NET 2.0 Basics 0 August 24th, 2007 05:53 AM
FormsAuthentication whfang ASP.NET 1.x and 2.0 Application Design 1 January 16th, 2007 05:42 PM
FormsAuthentication Class g2000 ASP.NET 2.0 Basics 2 November 24th, 2005 01:43 AM
FormsAuthentication.RedirectFromLoginPage shaileshmark General .NET 5 August 19th, 2004 05:17 PM
FormsAuthentication Class alyeng2000 ASP.NET 1.0 and 1.1 Basics 7 March 3rd, 2004 02:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.