Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Asp.Net Programming

Access to a file is denied


Hi,
I am trying to create an html based on two main objevts: XslTransform and
XmdTextWrite via asp.net2003 application.
I keep getting a strange msg: "Access to the path... is denied".

Here is my method:
-----------------------
XmlDataDocument xmlDoc=

new XmlDataDocument();
xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));

XslTransform tran=

new XslTransform();
tran.Load(Server.MapPath("test.xsl"));

XmlTextWriter w=new
XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8);
tran.Transform(xmlDoc,

null,w);
w.Close();

Hello Nimrod,

exception on Server.MapPath("test.xml") or on ReadXml?
Seems that user has no rights to read file

---
WBR,  Michael  Nemtsev [.NET/C# MVP].  
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

NN> Hi,
NN> I am trying to create an html based on two main objevts:
NN> XslTransform and
NN> XmdTextWrite via asp.net2003 application.
NN> I keep getting a strange msg: "Access to the path... is denied".
NN> Here is my method:
NN> -----------------------
NN> XmlDataDocument xmlDoc=
NN> new XmlDataDocument();
NN> xmlDoc.DataSet.ReadXml(Server.MapPath("test.xml"));
NN>
NN> XslTransform tran=
NN>
NN> new XslTransform(); tran.Load(Server.MapPath("test.xsl"));
NN>
NN> XmlTextWriter w=new
NN> XmlTextWriter(Server.MapPath("test.html"),System.Text.Encoding.UTF8)
NN> ; tran.Transform(xmlDoc,
NN>
NN> null,w); w.Close();
NN>

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc