Solved

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

Posted on 2008-10-05
1
301 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

I recently found myself in a Corporate Situation where the client had requested blocking access to any and all websites except his own Domain? Easy? I am sure this would be your answer but their requirement was, this has to be done without using…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
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.

832 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