Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 10th, 2005, 02:42 AM
Authorized User
 
Join Date: Apr 2005
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default A beginner in ASP.Net need help

Hi,

I am new in ASP.Net. I now doing a sys using VB.Net n SQL Server 2000.
I keep getting the same error for my login page, can somebody help me point out where is the problem? I really need help urgently.

Below are the error message I get:
Server Error in '/e-library' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'forms'

Source Error:


Line 38: -->
Line 39: <authentication mode="Forms" />
Line 40: <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
Line 41: </forms>
Line 42: </anthentication>


Source File: c:\inetpub\wwwroot\e-library\web.config Line: 40


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032


My coding (Web.Config file):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>

<compilation defaultLanguage="vb" debug="true" />

<customErrors mode="RemoteOnly" />

<authentication mode="Forms" />
    <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
        </forms>
</anthentication>

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

<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />

<sessionState
            mode="InProc"
            stateConnectionString="tcpip=127.0.0.1:42424"
            sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
            cookieless="false"
            timeout="20"
/>

<globalization requestEncoding="utf-8" responseEncoding="utf-8" />

</system.web>

</configuration>


My coding ( Login.aspx.vb file ):

Imports System.Web.Security
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text

Public Class WebForm1
    Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub cmdLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdLogin.Click
Dim con As SqlConnection
        Dim sql As String
        Dim cmd As SqlCommand
        Dim id As String

        con = New SqlConnection( _
             "data source=(local)\NetSdk; initial catalog=E-Library Records; user id=sa")
        sql = "SELECT User_id FROM [User] WHERE User='{0}' and Password='{1}'"
        sql = String.Format(sql, txtUser.Text, txtPassword.Text)
        cmd = New SqlCommand(sql, con)
        con.Open()

        Try
            id = CType(cmd.ExecuteScalar(), String)

        Catch ex As Exception

        Finally
            con.Close()
        End Try

        If Not id Is Nothing Then
            Response.Redirect("mainMenu.aspx")
        Else
            Response.Write
            ("Invalid User ID or Password:Please try again")
        End If
    End Sub

Thanks for any help.

Ai Ling





  #2 (permalink)  
Old May 10th, 2005, 04:26 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Hi

At a single glance, I found the following problem in your web.config
Code:
<authentication mode="Forms" /> 
    <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
        </forms>
</anthentication>
It should be
Code:
<authentication mode="Forms" /> 
    <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
</anthentication>
You had closed the forms tag twice. Please try with this modification.

Regards
Ganesh
  #3 (permalink)  
Old May 10th, 2005, 08:06 AM
Friend of Wrox
Points: 410, Level: 7
Points: 410, Level: 7 Points: 410, Level: 7 Points: 410, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2004
Location: New Delhi, India.
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubhav.kumar
Default

Hi to all

if i am not mistaken, in the following section
*******************************************
<authentication mode="Forms" />
    <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
        </forms>
</anthentication>
*******************************************

the line <authentication mode="Forms" /> should be <authentication mode="Forms">

Cheers.


Anubhav Kumar
  #4 (permalink)  
Old May 11th, 2005, 12:45 AM
Authorized User
 
Join Date: Apr 2005
Location: Kuala Lumpur, Wilayah Persekutuan, Malaysia.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Ganesh and Kumar,

I hv tried the suggestions, but still have error in the Web.config file.

If use Ganesh's method, hv the following error:

Server Error in '/e-library' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This is an unexpected token. The expected token is 'TAGEND'. Line 39, position 34.

Source Error:


Line 37: by Microsoft that offers a single logon and core profile services for member sites.
Line 38: -->
Line 39: <authentication mode="Forms"/ >
Line 40: <forms name="formLogin" loginURL="Login.aspx" protection="all" timeout="60"/ >
Line 41: </authentication>


Source File: c:\inetpub\wwwroot\e-library\web.config Line: 39


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032


If use Kumar's method, error is as following:

Server Error in '/e-library' Application.
--------------------------------------------------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: This is an unexpected token. The expected token is 'TAGEND'. Line 40, position 79.

Source Error:


Line 38: -->
Line 39: <authentication mode="Forms" >
Line 40: <forms name="formLogin" loginURL="Login.aspx" protection="all" timeout="60"/ >
Line 41: </forms>
Line 42: </authentication>


Source File: c:\inetpub\wwwroot\e-library\web.config Line: 40


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

May I know in the section <forms name="formLogin" loginURL="Login.aspx" protection="all" timeout="60"/ >, what is the forms name stands for? I use formLogin because that is my login page. Is it correct?

So anybody can help me, I really stuck in this page.

Thank you.

Ai Ling

  #5 (permalink)  
Old May 11th, 2005, 12:56 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

Code:
<authentication mode="Forms"> 
    <forms name="formsLogin" loginUrl="Login.aspx" protection="all" timeout="60"/>
</authentication>
watch out the spelling and the closing of tags while writing XML's

Regards
Ganesh
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what is wrong? I'am a beginner of asp.net. dqfverygood Wrox Book Feedback 16 December 19th, 2007 02:10 PM
Beginner to ASP .net 2.0 help chuckd ASP.NET 2.0 Basics 0 September 1st, 2006 11:31 PM
asp.net beginner ubsacc2004 ASP.NET 1.0 and 1.1 Basics 2 April 26th, 2006 10:49 AM
asp.net beginner LAKESIDE Classic ASP Databases 0 January 2nd, 2006 11:28 AM
ASP.NET beginner Anup Gavate ASP.NET 1.0 and 1.1 Basics 1 April 21st, 2005 12:49 PM



All times are GMT -4. The time now is 11:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.