tags:

views:

30

answers:

2
<a href="../../App_Data/form.xml">Download Sample Form </a>

Why is this link not working?

+1  A: 

If you mean constructing it using the MVC routing engine and helpers, the method Url.Content is what you're looking for.

Matteo Mosca
+2  A: 

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") %>
veggerby