Use a legacy ASP.NET ASCX User Control in MVC Razor view

前端 未结 3 2028
天涯浪人
天涯浪人 2021-02-04 05:07

I am trying to implement a MVC Razor _Layout.cshtml page that uses a WebForm ascx User Control (non-MVC). I am doing this based off the \"Yes\" section of this Scott Hansleman a

3条回答
  •  臣服心动
    2021-02-04 05:31

    You cannot use classic ASP.Net usercontrols (w/ postbacks and ViewState) in ASP.Net MVC.

    Html.Partial only allows you to render partial views, which happen to use the same extension, but are not the same.

提交回复
热议问题