将control传给view的字符串转为model实例
我也不知道我说的是否明白,最近研究mvc,确实有点很多,其中有个问题搞不定了
control层中的
[SupportFilter(ActionName ="Create")]
public ActionResult CreateExternal(string id)
{
Flow_FormModel formModel = formBLL.GetById(id);
//属于外部的页面,直接用于外部
ViewBag.Html = formModel.ExternalURL.Split(',')[0];
Flow_FormContentModel model = new Flow_FormContentModel();
model.FormId = id;
//创建成功取出步骤
List<Flow_StepModel> stepModelList = stepBLL.GetList(ref setNoPagerAscById, model.FormId);
Flow_StepModel stepModel = stepBLL.GetById(stepModelList[0].Id);
if (stepModel.FlowRule == (int)FlowRuleEnum.Customer)
{
ViewBag.Checker = null;
}
else
{
List<string> users = GetStepCheckMemberList(stepModel.Id, id);
ViewBag.Checker = users;
}
ViewBag.ModelName = formModel.Remark;
return View(model);
}
在view中希望将ViewBag.ModelName在页面中转为model,也就是将原来固定的model转为可以接受control传过来的model名称
<div id="setFormLayout" class="easyui-panel">
@Html.Partial(html, new Flow_ExternalModel())
</div>
不知道如何能把传进来的ViewBag.ModelName转为new +ViewBag.ModelName