问题描述
我需要从另一个视图调用视图。使用按钮单击。
我尝试过:
在我的视图中,
@using(Html.BeginForm(NotiHead,Header))
{
< button class =btn blue btn-block btn-outline>通知头< / button>
}
这是我的控制器。
公共ActionResult NotiHead()
{
NotiHdrEntity obj = new NotiHdrEntity();
返回查看(obj);
}
我的视图名称是NotiHead
非常感谢!
I need to call a View From Another View.Using Button Click.
What I have tried:
In My View,
@using (Html.BeginForm("NotiHead", "Header"))
{
<button class="btn blue btn-block btn-outline ">Notification Head</button>
}
this is my Controller.
public ActionResult NotiHead()
{
NotiHdrEntity obj = new NotiHdrEntity();
return View(obj);
}
And My View Name is NotiHead
Many Thanks !
推荐答案
@using (Html.BeginForm("NotiHead", "Header",FormMethod.Get))
{
<button type="submit" class="btn blue btn-block btn-outline ">Notification Head</button>
}
<a href="@Url.Action(" viewname","actionmethod")"=""> </a>
或
OR
@Html.ActionLink("Lable", "viewName", "Actionmethod")
谢谢!
Thank You !
这篇关于MVC中的html.beginform()出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!