如何使用 用户控件接受参数。

    技术2022-05-20  38

    在 使用用户控件时,如何向用户控件界面传递数据。方法如下:

    <% Html.RenderPartial("UserControl1Test",Model);%>

     

    在用户控件中如何接受Model参数。方法如下:

    Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<test.Models.OP_CashCoupon>>" %>

    向viewUserControl设置参数IEnumerable<test.Models.OP_CashCoupon>,这样就可以了。


    最新回复(0)