By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,310 Members | 1,988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,310 IT Pros & Developers. It's quick & easy.

Button not firing - and strange message

P: n/a
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.EventArgs) Handles btnLogin.Click
If checkUserExists(tbAccess_Name.Text, tbAccess_Password.Text)
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.ArgumentOutOfRangeException: 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:
[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +172
System.Web.UI.Util.GetScriptLocation(HttpContext context) +202

System.Web.UI.WebControls.BaseValidator.RegisterVa lidatorCommonScript()
System.Web.UI.WebControls.BaseValidator.OnPreRende r(EventArgs e) +44
System.Web.UI.Control.PreRenderRecursiveInternal() +62
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Control.PreRenderRecursiveInternal() +125
System.Web.UI.Page.ProcessRequestMain() +1489

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.