Note that there are some explanatory texts on larger screens.

plurals
  1. PORender View (or Partial) In another project?
    text
    copied!<p>i have a solution with the following two projects - MyNamespace.Services and MyNamespace.Web.</p> <p>Web contains a MVC web application.</p> <p>In the Service project i have a EmailService class that takes care of sending out emails to the user.</p> <p>I want to use either a partial or a view (ascx or aspx) for email templates. I have found several solutions on how to render a partial view and get the result as a string which works fine if the template is inside the web project (as it is a controller in the web project that calls the email service).</p> <p>(the 2 methods i am trying to use is either <a href="http://developersisland.blogspot.com/2009/01/renderpartial-to-string-in-aspnet-mvc.html" rel="noreferrer">http://developersisland.blogspot.com/2009/01/renderpartial-to-string-in-aspnet-mvc.html</a> (at the bottom of the blog) or <a href="http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/" rel="noreferrer">http://www.brightmix.com/blog/how-to-renderpartial-to-string-in-asp-net-mvc/</a>)</p> <p>But my email templates are located in the Services project.</p> <p>How can i refference the path to the templates (partial/view) in my Service project from inside the Web project, that works with either LoadControl or RenderPartial which both takes a virtual path as a parameter ?</p> <p>It seems like no matter what i do the root directory is set to the Web projects directory.</p> <p>Is it possible ?</p> <p>Would be nice to be able to make it work independently of the web project somehow.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload