|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
document.getElementById("ReportViewerID") returns nullI 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, On Thu, 6 Jul 2006 11:45:02 -0700, Billy wrote:
> I have a ReportViewer control (from reporting service) in one asp.net web It's pretty simple. If it's returning null, then that ID doesn't exist.> 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, Check the generated HTML and search for that ID, you aren't going to find it. I copied the ID to the function in the same aspx file. I am 100% sure it is
there. Show quoteHide quote "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. > 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. Show quoteHide quote "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. > > William, thank you.
You are right. The actual ID has been changed to "ReportFrameReportViewerID". Plus, these two tools are very good tools. Thanks again. Show quoteHide quote "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. > > > Hi,
Billy wrote: > William, thank you. There is no guarantee that it will always be ReportFrameReportViewerID > > You are right. The actual ID has been changed to > "ReportFrameReportViewerID". Plus, these two tools are very good tools. > > Thanks again. 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 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 I guarantee you, it's not. Just check the generated HTML like I said.> there. Don't be stubborn.
Access to Shared folder from asp.net
catch sql exception Atlas and other Ajax libraries Problem in Accepting Xml Data in TextBox one to one releation How to store/retrieve binary data in/from SQL server DB? Could not load assembly. Make sure that it is compiled before accessing the page. Session state has created a session id, but cannot save it because the response was already flushed redirecting a form's POST target ASP.NET application and windows services |
|||||||||||||||||||||||