MVC.net - How to use the ActionLink to a load view

How to use the ActionLink to a load view

@Html.ActionLink("Link Text", "ActionName", 
         new { controller = "MyController", id = 1 }, 
         new { @class = "my-class" })


Link Text is compulsary. if not provided it will raise exceptation. to overcome this 
instead of space use : press from keyboard between ""
alt+255 
 @Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = 0 },new { @class = "btn fa fa-plus-square fa-3x" })



Sending Addtional Parameter to Controller Action.

@Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = item.ID , CalledAction="E" }, new { @class = "btn fa fa-pencil-square-o fa-2x" })
@Html.ActionLink(" ", "EntryModule", new { controller = "Engineer", id = item.ID, CalledAction = "D" }, new { @class = "btn fa fa-trash fa-2x" })



Method in Controller
public ActionResult EntryModule(int ID,string CalledAction)
{
            
}

Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)