-4

I want to reuse partial view in multiple ASP MVC applications. Is it possible to do that? I have some partialview.cshtml which uses MyViewViewModel.cs and lots of typescripts/javascripts.

Is it possible to reuse all this code in different application?

If so, how I use views from external assembly?

5
  • Yeah it's possible. Commented Jan 3, 2017 at 9:48
  • okay, but how? how I use view from different assembly? Commented Jan 3, 2017 at 9:50
  • create partial view and pass model to it, Html.RenderPartial("partialView",new Model()); Commented Jan 3, 2017 at 9:51
  • @Dalton but I want to use partial view which I've already written in different application. How can I use it from other assembly? Commented Jan 3, 2017 at 10:42
  • @Maarty you'd have to implent your own 'CustomVirtualPathProvider ' this answer can help you in process link Commented Jan 3, 2017 at 11:04

1 Answer 1

1

look at razor generator: https://github.com/RazorGenerator/RazorGenerator

and look for samples in the internet

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.