Hi, Avnish
You can go from one view to another by two way:
- By link button
- By direct from action in controller
By link button:
put the link button in first view as:
ASPX View Engine=>
<a href="<%=Url.Action("FirstView","ViewController")%>">Go to second view</a>
OR
<%: Html.ActionLink("Go to second view", "FirstView", "ViewController")%>
RAZOR View Engine=>
<a href="@Url.Action("FirstView","ViewController")">Go to second view</a>
OR
@Html.ActionLink("Go to second view", "FirstView", "ViewController")
By direct from action in controller:
In action of first view as
public ActionResult FirstView(){
return View("SecondView");
}
Posted On:
16-Mar-2015 19:28