<a href="../../App_Data/form.xml">Download Sample Form </a>
Why is this link not working?
<a href="../../App_Data/form.xml">Download Sample Form </a>
Why is this link not working?
If you mean constructing it using the MVC routing engine and helpers, the method Url.Content is what you're looking for.
Files in App_Data are not served via HTTP you should place the XML file outside App_Data, eg. in /Content
Alternatively you must create an Action that returns the file contents via File action result, e.g.
public ActionResult SampleForm()
{
return File(Server.MapPath("~/App_Data/form.xml"));
}
And then link via:
<%= Html.ActionLink("Download Sample Form", "SampleForm", "MyController") %>