Jump to content


asp.net login error


4 replies to this topic

#1 markc1822

    Young Padawan

  • Members
  • Pip
  • 33 posts
  • Gender:Male
  • Location:New York

Posted 01 November 2007 - 02:26 PM

I need some help with this error i keep getting.

The username text box name is : Username
and the Password box is: Password

The Dataset name is : dsLogin

Any help i would appreciate it.

Thanks Mark

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: BC30455: Argument not specified for parameter 'Container' of 'Public Function FieldValue(FieldName As String, Container As System.Web.UI.Control) As String'.


Source Error:

 

Line 19: If IsPostBack Then
Line 20: ' authenticate user
Line 21: if ((Username.Text = dsLogin.FieldValue("Username")) AND (Password.Text = dsLogin.FieldValue("Password")) AND Username.Text <> Nothing AND Username.Text <>"" AND Password.Text <> Nothing AND Password.Text <>"")
Line 22: 
Line 23: FormsAuthentication.RedirectFromLoginPage(Username.Text, false)
 


#2 shameless_w_o_a_d

    Young Padawan

  • Members
  • Pip
  • 42 posts
  • Gender:Male
  • Location:New Zealand
  • Interests:Web Design, Graphics Design, Computers, Games, Music, Basketball

Posted 03 November 2007 - 06:49 PM

I don't know ASP to be able to help, but on line 21, wouldn't you want to use == to compare the values to, as opposed to = which assigns the value? This is to my knowledge of what each operator means, and the fact I don't know ASP could mean that certain things are different to what I know.

So instead of having ((Username.Text = dsLogin.FieldValue("Username")) you'd have ((Username.Text == dsLogin.FieldValue("Username")), as an example.

#3 markc1822

    Young Padawan

  • Members
  • Pip
  • 33 posts
  • Gender:Male
  • Location:New York

Posted 04 November 2007 - 08:54 AM

Thanks for the reply. The error is on line 21, i did what you suggested but it came up with another error on the same line (BC30201: Expression expected.) I have to go back and look at it probable missed something some where.

Mark

#4 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 04 November 2007 - 12:00 PM

I'm in the same boat as shameless in that i don't know ASP. But you have the "=" problem in 2 places in that conditional. Also, since i don't know if ASP is case-sensative or not, i see you at least have a consistensy problem.
If IsPostBack Then
' authenticate user
if ((Username.Text = dsLogin.FieldValue("Username"))...
The i's in "if" are different case. Also, the second conditional doesn't have a "Then" after it. Again, it would help if i know more about ASP (i doubt anybody here really does know ASP), but these are semi-common problems across the languages i know.

#5 markc1822

    Young Padawan

  • Members
  • Pip
  • 33 posts
  • Gender:Male
  • Location:New York

Posted 04 November 2007 - 12:03 PM

I got it to work, i had to download a modified DreamweaverCtrls.dll file. Thanks for the suggestions

Mark

Edited by markc1822, 04 November 2007 - 12:07 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users