How to create reusable control in ASP.NET MVC

后端 未结 4 1277
有刺的猬
有刺的猬 2021-02-03 12:42

How can/should I create some \"custom control\" in ASP.NET MVC 3? I have red about partial views, ViewUsersControl, Html.RenderAction, but I still don\

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 13:21

    As you have mentioned that you can use Partial Views. Yes you can use Partial Views, which is the most effective and efficient way.

    For Ajax rendering you can always use

         @using (Ajax.BeginForm("Details", new { id = Model.Post.PostId }, new AjaxOptions    
      {
    

    Few of the links you would like to see

    Rendering partial view in ASP.Net MVC3 Razor using Ajax

    Render Partial Views using JQuery in MVC3

提交回复
热议问题