Solved

Why is my .NET XML Control not working in Firefox?

Posted on 2008-10-05
1
300 Views
Last Modified: 2013-12-07
I have a .NET XML Control on my page which holds the following data for example:

<XML ID="CompanyModulePages">
 <NavPages>
  <NavPage>
    <Tier>1</Tier>
    <Description>Home</Description>
    <CssClass>CatHeader</CssClass>
    <ImageLocation></ImageLocation>
    <WebPath>/modules/Ordering/welcome.aspx</WebPath>
    <WebParms></WebParms>
  </NavPage>
  <NavPage>
    <Tier>2</Tier>
    <Description>Search/Browse Items</Description>
    <CssClass></CssClass>
    <ImageLocation></ImageLocation>
    <WebPath>/modules/Ordering/Orders/ItemSearch.aspx</WebPath>
    <WebParms></WebParms>
  </NavPage>
</NavPages>
</XML>

I don't actually want the XML data displayed in any way on the screen, but I want to be able to access the XML control in Javascript.  This works fine in IE but I am having the following problems in Firefox:

1.  The XML is displayed on the screen as plain text in Firefox, while being hidden in IE.  I want it to be hidden because I am only using this control to store XML information which I will be using in Javascript.  For Example, it's displayed as follows in Firefox:

 1  Home  CatHeader   /modules/Ordering/welcome.aspx     2  Search/Browse Items    /modules/Ordering/Orders/ItemSearch.aspx     2  English        3  Booth Display  CatHeader   /modules/Ordering/Orders/ItemCategory.aspx  txtWebCategory=923

In IE, this information is not displayed, which is what I want.

2.  I can access the control in IE using either this method (CompanyModulePages is the ID of the control):

oXML = document.getElementById("CompanyModulePages").XMLDocument;      

Or this method:

oXML = CompanyModulePages.XMLDocument;      

In Firefox, the first method retrieves a control but it seems to be an unknown control and I can't retrieve the XML Document.


Anyone have any ideas on this subject?


Thank you.
0
Comment
Question by:Leo Eikelman
1 Comment
 
LVL 9

Accepted Solution

by:
HeoQue earned 500 total points
ID: 22858014
that should work in FireFox, however try getting the control name dynamically instead :

oXML = document.getElementById('<%=CompanyModulePages.ClientID %>').XMLDocument;    
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now