Solved

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

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

757 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

18 Experts available now in Live!

Get 1:1 Help Now