VB.NET Coding error

Hi, I was creating a webform and I got one error and I don't know what does it means can anyone help me with it

The Error: Reference to a non-shared member requires an object reference.

The underline and bold line.

My login Page:

Username:<asp:TextBox ID="UserID" runat="server">User1</asp:TextBox>

Try

If s.Connected Then

s.Send(bytesSent, bytesSent.Length, 0)

Do

bytes = s.Receive(bytesReceived, bytesReceived.Length, 0)

receiveText = Encoding.ASCII.GetString(bytesReceived, 0, bytes)

receiveXMLText = receiveXMLText + receiveText

If receiveText.IndexOf("</packet>") Then

quitRequest = True

receiveXMLText = receiveXMLText & "</packet>"

End If

'Application.DoEvents()

Loop While quitRequest = False

quitRequest = False

reply = New StringReader(receiveXMLText)

xmlRead = New XmlTextReader(reply)

While xmlRead.Read

Select Case xmlRead.NodeType

Case XmlNodeType.Text

LoginResult = xmlRead.Value

If LoginResult.Equals("1") Then

Controller.docInfo = Login.UserID.Text

'Application.DoEvents()

Else

MsgBox("Sorry, you have entered an invalid username or password.", MsgBoxStyle.Exclamation, "Error")

End If

Exit While

End Select

End While

End If

Catch ex As Exception

End Try



Answer this question

VB.NET Coding error

  • swells

    try:

    Me.UserID.Text



  • Tom08

    I change to Me.UserID.Text but a new error come out.

    Error: 'Me' is valid only within an instance method.

    What does an instance method here refer to

    Do I need to add anything in the code

    Thanks


  • re infecta

    what about:

    UserID.Text



  • VB.NET Coding error