473,804 Members | 3,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error with client script + EditCommands

Hi,

I have the following server code that attaches a client side script to the
Update command of the data grid.
Private Sub clientExc_ItemC reated(ByVal sender As Object, _
ByVal e As System.Web.UI.W ebControls.Data GridItemEventAr gs)
Handles clientExc.ItemC reated

If e.Item.ItemType = ListItemType.Ed itItem Then
CType(e.Item.Ce lls(4).Controls (0),
LinkButton).Att ributes.Add("on click", "buttonClick(th is);")
End If
End Sub
The javascript is in an external js file.

What happens is when the page is loading in Edit mode after clicking the
edit button, but before clicking the update button, I see the following
script error:
'undefined' is null or not an object.

I have no idea what it is complaining about. If you have any ideas or
suggestions please feel free to post them.

Thank You!
Nov 19 '05 #1
5 1156
This usually means that the function is not correctly specified, misspelled
or missing.

Make sure that you are correctly referencing the JavaScript file on your
page. You can debug JavaScript by looking at the running documents when you
are in debug mode.

Also, view source when your page loads in the browser. Make sure that the
script was attached and the reference is included in the page.
--
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group

Future Business Model
Loan Origination Services
National City Mortgage
"Chad" wrote:
Hi,

I have the following server code that attaches a client side script to the
Update command of the data grid.
Private Sub clientExc_ItemC reated(ByVal sender As Object, _
ByVal e As System.Web.UI.W ebControls.Data GridItemEventAr gs)
Handles clientExc.ItemC reated

If e.Item.ItemType = ListItemType.Ed itItem Then
CType(e.Item.Ce lls(4).Controls (0),
LinkButton).Att ributes.Add("on click", "buttonClick(th is);")
End If
End Sub
The javascript is in an external js file.

What happens is when the page is loading in Edit mode after clicking the
edit button, but before clicking the update button, I see the following
script error:
'undefined' is null or not an object.

I have no idea what it is complaining about. If you have any ideas or
suggestions please feel free to post them.

Thank You!

Nov 19 '05 #2
It appears to be executing the javascript code because an alert box i
showing, I can't seem to figure out how to debug the script.
Nov 19 '05 #3
OK I got it to debug finally, the error is in a MS Script
function ValidatorOnLoad
Very strang since I commented out these controls, now I removed them and no
error.
Nov 19 '05 #4
You commented out the controls on your aspx page or the code behind? If you
commented them out of the aspx page, then they might still be in the code
behind page. They would get added to the form on load, then the client side
script wouldn't see the validator object. Boom! Error! When you comment
out a control on the aspx page, make sure they are removed from the code
behind.

The IDE will usually re-declare the object if you comment it out in the code
behind and not the aspx page.
--
Staff Consultant II
Enterprise Web Services
Cardinal Solutions Group

Future Business Model
Loan Origination Services
National City Mortgage
"Chad" wrote:
OK I got it to debug finally, the error is in a MS Script
function ValidatorOnLoad
Very strang since I commented out these controls, now I removed them and no
error.

Nov 19 '05 #5
I commented out the controls in the aspx page and verfied that there was no
more declarations for them in the codebehind. The page must have been cached
or something, not sure.
Thank you for your help!
Nov 19 '05 #6

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

Similar topics

5
2543
by: Philip Ronan | last post by:
OK, here's my 2p worth: === Q. Why am I getting the error message 'Headers already sent'? A. PHP produces this error message when you try to set a header for a web page after you have already started sending out the content of the page. Web content is always delivered with a few headers at the top, ending with a blank line. For example, a web page might start like this:
1
1673
by: questionr | last post by:
There is a spell checker function which is written in VB Script. The function works well when tested seperately. But when the function is called from Java Script, the function shows an Error saying " A run time error has occured. Do you wish to debug? Line :0 , Object Expected". I just know that it is a Java Script error. Any suggestions on how to resolve this problem ? What could be the possible reasons for this error message?
0
2132
by: Roman | last post by:
I'm trying to create the form which would allow data entry to the Client table, as well as modification and deletion of existing data rows. For some reason the DataGrid part of functionality stops working when I include data entry fields to the form: I click on Delete or Edit inside of DataGrid and get this error: "Error: Object doesn't support this property or method" If I remove data entry fields from the form - DataGrid allows to...
25
17225
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from being uploaded. I'm also using the HtmlInputFile control to do the uploading. My problem is that when the user's file size exceeds 512k, the page immediately redirects to the "The page cannot be displayed" error page which is very confusing. ...
7
16276
by: dd | last post by:
Hello all. First, I'm a newbie to javascript but not to ASP. Secondly I've been searching for the answer for two hours and I decided to finally post this question. I'm trying to take a javascript and make it work with asp. Any thought, ideas or pointers in the right direction would be greatly appreciated. I am getting the following error: Microsoft JScript runtime error '800a1391'
5
2009
by: Bjorn Sagbakken | last post by:
Hello I have just migrated from VS 2003 to VS 2005, and .NET framework 1.1 to 2.0 I am at the end of debugging and fixing stuff. Now there is one error I just cannot find a solution to: On some pages I have applied a small client-script to trap the enter-key beeing pressed and re-route this action. With the new version this little script still works, it traps the enter-key. BUT it causes postback-errors on many other .NET control,...
2
9275
by: pranas | last post by:
I'm not a proffessional programmer and I'm asking for your help. I'm using PHP and running Apache server and Mysql database server on my home network computer to serve my web site. My PHP error log is getting as big as more than 1MB daily. Looks like somebody is bombarding my site with strange requests constantly and I believe it is slowing my server. I'm correct? If so, how I can get rid of that?Below is example of my error log: client sent...
7
1511
by: adrian.bartholomew | last post by:
Im getting an error: Error: unterminated string literal Source File: http://98.214.38.110/allfours/site_flash/2.php Line: 75, Column: 37 Source Code: if (_ie == true) document.writeln(' ___________________________________
10
6982
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration of section c. Not sure where went wrong as the web page displayed internal server error. Also, what is the error 543? and error 2114. Where to find the list of errors in websites as it is not the standard apache error. I could not find...
0
9706
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
10571
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
10326
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
10317
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
9143
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...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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();...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.