Button not firing - and strange message

M

Mark

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)
Then
Response.Redirect("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.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.RegisterValidatorCommonScript()
+69
System.Web.UI.WebControls.BaseValidator.OnPreRender(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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top