Thursday, March 22, 2012

Login Page

Hi .Net

I just started playing with Web Matrix and i can`t get a Login Page with Access Database to work. The Error is:Server Error in '/' Application.
------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30689: Statement cannot appear outside of a method body.

Source Error:

Line 18: End Sub
Line 19:
Line 20: If Page.IsValid Then
Line 21:
Line 22: Function GetUser(ByVal username As String, ByVal password As Integer) As System.Data.DataSet

What am is wrong with me?! probably that i`m absolutly new to the .Net stuff

Thank you in advanced for any help or suggestions!hello, can we have some code please ? to see what u are doing !!!
Hallo haidar bilal

The problem i had yesterday is fine now but oh wonder i have a new one now!!

The code is here:


<%@. Page Language="VB" %>
<script runat="server"
Sub LoginBtn_Click(Sender As Object, E As EventArgs)

If Page.IsValid Then
Dim userDS As New System.Data.DataSet

userDS = MyQueryMethod(UserName.Text, UserPass.Text)

If userDS.Tables(0).Rows.Count = 1 Then
FormsAuthentication.RedirectFromLoginPage(UserName.Text, true)
Else
Msg.Text = "Invalid Credentials: Please try again"
End If
End If


And the new Error is: Line:4 Char:9 Error: Expected';' Code:0
The Page is running fine with the Web Matrix Server but if i try to run it in an IIS i get the Error.
Thank you for your help!
Hallo!!

my problem from yesterday is resolved but i have oh wonder a new one.

Code:


<%@. Page Language="VB" %>
<script runat="server"
Sub LoginBtn_Click(Sender As Object, E As EventArgs)

If Page.IsValid Then
Dim userDS As New System.Data.DataSet

userDS = MyQueryMethod(UserName.Text, UserPass.Text)

If userDS.Tables(0).Rows.Count = 1 Then
FormsAuthentication.RedirectFromLoginPage(UserName.Text, true)
Else
Msg.Text = "Invalid Credentials: Please try again"
End If
End If


Error:Line:4 Char:9 Error:Expected';' Code:0

Thank you for your interest!



Edit by moderator - NetProfit: Added code tags.
Do you have an

End Sub

in there for your button click event?
Hi!

yes i have the End Sub.

The thing is the page is running in the Web Matrix Server, it shows the button and the text fields for the username and the password and it accepts the user and pass and passes me on to the next page.But all this is not working with the IIS.
can u please tell me which is line4 ?
The 4th Line is:

Sub LoginBtn_Click(Sender As Object, E As EventArgs)

0 comments:

Post a Comment