I want to make it works in my umbraco project. Where can I insert my xml file to be read by a macro.
I have a macro with this code in my page, but it's returning a erro message:
Error creating control (usercontrols/Loja Virtual/cadastroControl.ascx).
Maybe file doesn't exists or the usercontrol has a cache directive,
which is not allowed! See the tracestack for more information!
How to parse a xml file into umbraco?
I have a xml file with a list of cities, and I wrote an c# code to get it into a drop down list.
Here is my code:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadXML();
}
}
public void LoadXML()
{
string cidadeXml = Server.MapPath("~/cidades.xml");
DataSet dsCidade = new DataSet();
dsCidade.ReadXml(cidadeXml);
cidadeDDL.DataSource = dsCidade;
cidadeDDL.DataTextField = "NOME";
cidadeDDL.DataValueField = "NOME";
cidadeDDL.DataBind();
}
I want to make it works in my umbraco project. Where can I insert my xml file to be read by a macro.
I have a macro with this code in my page, but it's returning a erro message:
Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!
Hi Mila
Add "?umbDebugShowTrace=true" to your page to get output on what is causing the error.
If you can't solve the problem from the resulting output then post the error message and someone may be able to assist.
Cheers
Nigel
Thank you very much, Nigel.
I solved my problem by setting my xml files as directory virtual. It´s working fine now :)
is working on a reply...