Hi - I have a really strange problem - straight forward login code (on
the event of a button press).
Works perfectly locally - but when I upload to my host, I get the
message and stack shown below.
If I take out the 'Handles btnLogin.Click' - then it doesn't fire the
btnClick routine - BUT - the page will display on my host (albeit it
won't do anything when I press the button)? I'd really appreciate some
help with this.
(in my login.aspx.vb page):
Private Sub btnLogin_Click( ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnLogin.Click
If checkUserExists (tbAccess_Name. Text, tbAccess_Passwo rd.Text)
Then
Response.Redire ct("admin.aspx" )
Else
lbMessage.Text = "Username or password not found - please
try again"
End If
End Sub
Error message on host if I leave in 'Handles btnLogin.Click' :
Length cannot be less than zero. Parameter name: length
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Argument OutOfRangeExcep tion: Length cannot be
less than zero. Parameter name: length
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[ArgumentOutOfRa ngeException: Length cannot be less than zero.
Parameter name: length]
System.String.S ubstring(Int32 startIndex, Int32 length) +172
System.Web.UI.U til.GetScriptLo cation(HttpCont ext context) +202
System.Web.UI.W ebControls.Base Validator.Regis terValidatorCom monScript()
+69
System.Web.UI.W ebControls.Base Validator.OnPre Render(EventArg s e) +44
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +62
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +125
System.Web.UI.C ontrol.PreRende rRecursiveInter nal() +125
System.Web.UI.P age.ProcessRequ estMain() +1489
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!