473,748 Members | 7,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Button not firing - and strange message

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!
Nov 18 '05 #1
0 1044

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
730
by: Mark | last post by:
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.
1
2923
by: Bin Song, MCP | last post by:
Hi all I got a strange problem In my webform, I have a server-side Button "btnDisable" to save some data and enable or disable all other fields in this form based on the data. The logic is: on server click event, save data, write a client-side script to set 'ynDisable' to true or false, and then use general client-side code in window's onload event to disable all fields. The code is function disableFields( with (window.document var...
2
9854
by: ~~~ .NET Ed ~~~ | last post by:
I have a problem (don't we all?). I have a web form with multiple modules, some of these modules have an ASP.NET (server run) button. OK, now I have UserControlX which has one such button (say Login). In that user control I defined both the Command and Click events for the button and placed a break point on it (in addition to traces). This user control is then included in the main form within the Form element/tags. Both the user control...
5
1973
by: csgraham74 | last post by:
Hi guys, I posted regarding this issue the other day but i still dont have an answer to my problem. Basically i have imported asp.net pages from dreamweaver into visual studio. Ive added a few controls that ive copied in from another asp.net page that i built within visual studio. The problem is that the asp:button does not fir an event and therefore my code behind it wont work. The page load event is firing correctly so i think the...
3
1639
by: Aahz | last post by:
I have big asp.net , c# project with many buttons and image buttons that suddenly stop firing, when you click on button form -nothins happen. What strange that in Firefox they are still work fine, but not in IE. When I create another project buttnons work without problems so it seems my project is somehow screwed up. I tried move project to another computer - same thing. I tried to reinstall framework (aspnet_regiis.exe), it didn't...
19
10209
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another app using web application projects and it's firing fine but it was upgraded from the 1.1 framework. Why doesn't my global.asax application_error routine fire?
8
17625
by: SAL | last post by:
Hello, I have a button on a webform that has an OnClick event defined as such: <asp:Button ID="btnSearchByName" runat="server" Text="Search By Name" OnClick="btnSearchByName_Click" Width="152px" EnableViewState="False" CausesValidation="False" /> the btnSearchByName_Click event fires the second time the button is clicked but not the first. Is there something I'm missing on getting the thing to fire the first time it's clicked instead...
3
5517
by: Jay | last post by:
I am on the 2.0 framework and have run the c:\windows\microsoft.net \framework\v1.1.4322\aspnet_regiis.exe -c and had no success. About half of the buttons on my webforms are firing and the other half are not, primarily anything on the Master is firing but those in the content pane are not. This was working fine yesterday!! I've reviewed all the code changes and can't seem to find a culprit. Here's one example of what I'm trying to...
5
5893
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of the screen. I have been unable to find any way to disable this button in Access 2007 and subsequently I have been forced to find ways to detect and handle the situations after the Access Close button has been clicked. I have been largely...
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.