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