Hello. I have a base controller abstract class, which my other controllers inherit. This class needs to load a local xml file in order to create some buttons for the master page. Given that the ControllerContext is null at this stage, what is the best practice for loading the file? (When running on the webserver, I get the following error: Could not find a part of the path 'c:\windows\system32\inetsrv\Content\Xml\Buttons.xml'.)
Current code is
using System.Web.Mvc;
using Site1.Models;
namespace Site1.Controllers
{
[SkyArts.Models.Master]
public abstract class BaseController : Controller
{
public BaseController()
{
XDocument buttonsXmlDoc = XDocument.Load("Content/Xml/Buttons.xml");
}
}
}
The document is actually loaded from a Model class, but I've left this out for brevity.
As a side issue, would you put xml files in Content or in App_Data?