What is the preferred method of getting correct design time support for Master Pages when running an MVC application from a virtual directory?
For example, given the following image tag in the master page:
<img src="../../Content/Images/myimage.jpg" alt="image" />
This will provide full design time support in the master pages and all views that use the master page, but when running the app from http://localhost/MyApp/, the image will of course not be found (browser is looking for http://localhost/Content/Images/Banner.png).
Changing the image to:
<img src="<%=Url.Content("~/Content/Images/myimage.jpg")%>" alt="image" />
Will fix the runtime display, but breaks design time support in the master page and views.
A third option is to change the image tag to runat=server as follows:
<img runat="server" src="../../Content/Images/myimage.jpg" alt="image" />
This works for both runtime and design time, but having to specify a runat="server" seems like kind of like a hack.
Is there a better way to handle this?
Edit: The option cagdas is proposing will work at design time, but not at run time:
<img src="/Content/Images/myimage.jpg" alt="image" />