Using properties in asp:xml?

Vote:
 
Is it possible to use properties within the asp:xml webcontrol? I can't get it to work with properties. Hard coded path works... Line 18: " transformsource="<%=CurrentPage["xslpath"]%>" runat="server" /> Exception Details: System.ArgumentException: Illegal characters in path. Second example: " transformsource="<%#CurrentPage["xslpath"]%>" runat="server" /> This generates an empty page without data :/ My template is in c:/inetpub/nmcwebb/templates/nmc/nmc-xml.aspx XML & XLS in c:/inetpub/nmcwebb/ xmlpath = ../../document.xml xslpath = ../../stylesheet.xsl /Markus
#13091
Jun 27, 2007 14:01
Vote:
 
I suggest using page_Load in code behind. protected void Page_Load(object sender, EventArgs e) { Xml2.DocumentSource = CurrentPage["xmlpath"]; Xml2.TransformSource = CurrentPage["xslpath"]; } (OBS... Syntax not tested) And in the aspx just have "" on these properites or just not have them there. Another tip is to make use of Server.MapPath() for physical paths. Hope that gives some help/ideas
#15405
Jun 27, 2007 14:12
Vote:
 
Thank you Johan, worked with a few modifications :) public class xml : TemplatePage { public Xml Xml1; private void Page_Load(object sender, System.EventArgs e) { Xml1.DocumentSource = CurrentPage["xmlpath"].ToString(); Xml1.TransformSource = CurrentPage["xslpath"].ToString(); // Put user code to initialize the page here }
#15406
Jun 27, 2007 14:57
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.