Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 !
Posted
Updated 26-Oct-16 1:09am
Comments
F-ES Sitecore 6-Oct-16 5:43am    
What do you mean by "call a view"?

You need to add button type as submit and set form method type as well get or post, it looks like get would work as you are not posting any data:

HTML
@using (Html.BeginForm("NotiHead", "Header",FormMethod.Get))
{
<button type="submit" class="btn blue btn-block btn-outline ">Notification Head</button>
}
 
Share this answer
 
Comments
T_Sub 7-Oct-16 0:58am    
Thank You Very Much Its Working !!
instead of this way we can use

HTML
<a href="@Url.Action(" viewname","actionmethod")"=""> </a>


OR

HTML
@Html.ActionLink("Lable", "viewName", "Actionmethod")




Thank You !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900