Solved

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

Posted on 2008-10-05
1
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Do you come here a lot? Are you lazy like me and don't want to go through the "trouble" of having to click your Dock's Safari icon and then having to click your Experts Exchange Favorites bookmark to get here? Well then this article is for you.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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 +…
Suggested Courses

635 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