473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

document.getElementById("ReportViewerID") returns null

I have a ReportViewer control (from reporting service) in one asp.net web
page. The document.getElementById("ReportViewerID") always returns a null.
Other controls in the pages seems OK and the function can return the right
object. Could anyone help me out?

Thanks,

Jul 6 '06 #1
6 4013
On Thu, 6 Jul 2006 11:45:02 -0700, Billy wrote:
I have a ReportViewer control (from reporting service) in one asp.net web
page. The document.getElementById("ReportViewerID") always returns a null.
Other controls in the pages seems OK and the function can return the right
object. Could anyone help me out?

Thanks,
It's pretty simple. If it's returning null, then that ID doesn't exist.
Check the generated HTML and search for that ID, you aren't going to find
it.
Jul 6 '06 #2
I copied the ID to the function in the same aspx file. I am 100% sure it is
there.
"Erik Funkenbusch" wrote:
On Thu, 6 Jul 2006 11:45:02 -0700, Billy wrote:
I have a ReportViewer control (from reporting service) in one asp.net web
page. The document.getElementById("ReportViewerID") always returns a null.
Other controls in the pages seems OK and the function can return the right
object. Could anyone help me out?

Thanks,

It's pretty simple. If it's returning null, then that ID doesn't exist.
Check the generated HTML and search for that ID, you aren't going to find
it.
Jul 6 '06 #3
Your ID for your report viewer is "ReportViewerID"? Double check that.
Also, if you are using master pages and content pages, the content
placeholder ID is prepended to all controls contained in it. That means,
when the page is rendered to the client, the actual ID for the report viewer
would be something like "ContentPlaceholder00_ReportViewerID". Definitely
grab a client-side debugging tool like Fiddler or the Explorer developer
toolbar and look at the HTML on the client side. You may be surprised.

"Billy" wrote:
I copied the ID to the function in the same aspx file. I am 100% sure it is
there.
"Erik Funkenbusch" wrote:
On Thu, 6 Jul 2006 11:45:02 -0700, Billy wrote:
I have a ReportViewer control (from reporting service) in one asp.net web
page. The document.getElementById("ReportViewerID") always returns a null.
Other controls in the pages seems OK and the function can return the right
object. Could anyone help me out?
>
Thanks,
It's pretty simple. If it's returning null, then that ID doesn't exist.
Check the generated HTML and search for that ID, you aren't going to find
it.
Jul 6 '06 #4
William, thank you.

You are right. The actual ID has been changed to
"ReportFrameReportViewerID". Plus, these two tools are very good tools.

Thanks again.
"William Sullivan" wrote:
Your ID for your report viewer is "ReportViewerID"? Double check that.
Also, if you are using master pages and content pages, the content
placeholder ID is prepended to all controls contained in it. That means,
when the page is rendered to the client, the actual ID for the report viewer
would be something like "ContentPlaceholder00_ReportViewerID". Definitely
grab a client-side debugging tool like Fiddler or the Explorer developer
toolbar and look at the HTML on the client side. You may be surprised.

"Billy" wrote:
I copied the ID to the function in the same aspx file. I am 100% sure it is
there.
"Erik Funkenbusch" wrote:
On Thu, 6 Jul 2006 11:45:02 -0700, Billy wrote:
>
I have a ReportViewer control (from reporting service) in one asp.net web
page. The document.getElementById("ReportViewerID") always returns a null.
Other controls in the pages seems OK and the function can return the right
object. Could anyone help me out?

Thanks,
>
It's pretty simple. If it's returning null, then that ID doesn't exist.
Check the generated HTML and search for that ID, you aren't going to find
it.
>
Jul 6 '06 #5
Hi,

Billy wrote:
William, thank you.

You are right. The actual ID has been changed to
"ReportFrameReportViewerID". Plus, these two tools are very good tools.

Thanks again.
There is no guarantee that it will always be ReportFrameReportViewerID
so better not use that as a constant. Use your control's ClientID
instead of it's ID. ClientID is the string which will be sent to the client.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Jul 6 '06 #6
On Thu, 6 Jul 2006 12:12:01 -0700, Billy wrote:
I copied the ID to the function in the same aspx file. I am 100% sure it is
there.
I guarantee you, it's not. Just check the generated HTML like I said.
Don't be stubborn.
Jul 7 '06 #7

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

Similar topics

2
by: Rene van Hoek | last post by:
Hi, I am using Xalan 1.8.0 and Xerces 2.6.0 in C++. I have an XML document which I first transform into an other XML document using an XSL styelsheet. Then I want to parse with XPathEvaluator...
1
by: Suresh | last post by:
Hi, I have an C# CSEXE.exe (CSexe.cs) and a CSDll.dll (CSdll.cs). exe is compiled with a reference to dll. Calling for the class Type defined in CSDLL.dll using Type.GetType(...
2
by: Jeff Adams | last post by:
I am using MSVC .NET to create a C program. I am having trouble creating a window. The createwindow returns NULL however no error is caught. The GetLastError() returns "operation completed...
1
by: BeckyB00 | last post by:
Slightly different situation from the question of the 11/18/05 but the same error. (I'm just learning about web services so this is based on a 'quick tutorial') I'm running a web service using...
0
by: Zean Smith | last post by:
I am trying to get my C# client to connect to a 3rd Perl Web Service (SOAP Lite), this is the code that fails ...... object results = this.Invoke("getGrossData", new object {week} ); return...
11
by: MLH | last post by:
I have 2 lines in a procedure that assign MyVariant a value - line #238 and line #491. When line #238 runs, the value is 152. When line #491 runs, the DLookup function returns Null. I would expect...
1
by: js | last post by:
I am using the following C# code and T-SQL to get result object from a SQL Server database. When my application runs, the ExecuteScalar returns "10/24/2006 2:00:00 PM" if inserting a duplicated...
3
pragathik
by: pragathik | last post by:
hi, i have a problem with document.body.offsetTop and document.body.offsetLeft always returns null in my code in IE6. how can I get the values???? please suggest
2
by: wizardry | last post by:
hello - i'm trying to insert a blob into my table, it will insert but the string that i insert when i query the inserted data returns null with 0 bytes in the column. I have other tables set...
9
by: ipanos | last post by:
Hey guys... I am not too knowledged in js and I code in it occasionally, so please excuse the question if it is steight forward... Now... Been working on an analogue clock script, customised...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.