PDA

View Full Version : XML file in a IFRAME



habeebuddin
03-12-2008, 01:21 PM
Hi,
I am using ASP.Net2.0 and I want to display an xml file in an IFRAME. If we open an xml file in the Internet explorer it would display in a proper format. But when I try to set the iframe url to the file location, then it is not displaying anything:confused:. Does anyone have any idea why IFRAME is not displaying my xml file in asp.net page.

I am sending the code that i used.

var iframe = document.getElementById('xmlFrame');
var strPath = "C:\\Documents and Settings\\home\\Desktop\\test.xml";
iframe.src = strPath;

I tried even the following.
document.frames[0].location = strPath;
but is of no use.



Regards,
Habeeb.

habeebuddin
03-13-2008, 05:39 AM
Hi,
I figured out the problem. I placed the xml file in a shared location with full security permissions. And then assigned the shared path location of xml file to the iframe.src.

Regards,
Habeeb.