controller cs

public ActionResult AdvanceSearchForm()
        {
            SearchCriteriaModel model = new SearchCriteriaModel { SearchInAll = true };
            return PartialView("AdvanceSearchForm", model);
        }

 

用法1 cshtml

@Html.Action("AdvanceSearchForm")

这种访问方式,先会去controller 执行AdvanceSearchForm 这个action ,然后再回到cshtml

 

用法2 cshtml

@Html.Partial("AdvanceSearchForm",new SearchCriteriaModel { SearchInAll = true })

这种访问方式,不会去controller ,而是直接到cshtml

 

相关文章:

  • 2021-11-26
  • 2021-07-19
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2022-01-10
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-05
  • 2021-12-10
  • 2021-10-05
  • 2022-12-23
相关资源
相似解决方案