• How to use ActionLink, PartialView, RenderAction and Action in ASP.NET MVC?

    by  • October 16, 2015 • Microsoft .NET Framework, Microsoft ASP.NET MVC, Microsoft Visual Studio .NET • 0 Comments

    There are different ways for rendering a partial view in MVC Razor. Many developers got confused whether to use  RenderAction or Partial or Action helper methods for rendering a partial view. But ActionLink is different from them. This article shows how to use Html.ActionLink, Html.RenderAction, Html.Partial  and Html.Action in ASP.NET MVC.

    View.cshtml:

    Before wirtes view.cshtml code, the following points are important to understand about Html.ActionLink, Html.RenderAction, Html.Partial  and Html.Action.

    • ActionLink creates a link on a page and the user clicks it redirect to other URL.
    • RenderAction method is useful when data is show in view that is independent from corresponding view.
    • Partial only calls a partial view.
    • RenderAction method is useful when data is show in view that is independent from corresponding view.

    Controller.cs:

    In Controller all actions are define which calls from view by Html.ActionLink, Html.RenderActi0on, and Html.Action .

     




    Best WordPress Themes and Plugins with Great Team and Support!

    Avatar of Abdul Rehman

    About

    Abdul Rehman writes on .NET technologies at GetCodeSnippet.com. GetCodeSnippet.com provides you high quality Microsoft .NET development related articles, tutorials and sample code for ASP.NET, C#, VB.NET, AJAX, WCF, WPF, Web Services, Windows Services, SQL Server and other technologies.

    http://getcodesnippet.com

    Leave a Reply