Sharing ASP.NET MVC partial views between projects

后端 未结 4 547
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 01:29

What is the best way to share a common Partial View between applications? I\'ve created a separate assembly containing my Partial View in an ascx file, some scripts that go wit

4条回答
  •  既然无缘
    2021-02-04 01:58

    This is an ongoing issue even with WebForms. Sharing this stuff is not easy.

    My prefered approach now is to create my controls either as mvc WebControls or as jQuery plugins. That way I can pass around a versioned DLL or script file.

    I lean heavily towards the WebControls solutions because, like I said, I can version it and put it in the company infrastructure framework.

    I then (only) use PartialViews to render the webcontrols and add some basic flair, markup or content.

提交回复
热议问题