Questions tagged [html.actionlink]

html.actionlink is an HTML Helper in ASP.NET MVC framework. It enables to render an HTML link by using HTML.ActionLink().

With MVC, HTML helpers are much like traditional ASP.NET Web Form controls.

Just like web form controls in ASP.NET, HTML helpers are used to modify HTML. But HTML helpers are more lightweight. Unlike Web Form controls, an HTML helper does not have an event model and a view state. MVC includes standard helpers for the most common types of HTML elements, like HTML links and HTML form elements.

285 questions
2
votes
4 answers

Display an HTML Code like ® or © in an Html.ActionLink Text

unfortunately, I was not successful with my research for this topic. With an anchor tag, I was able to do this: My Link ® Now I want the same with an Html.Actionlink: @Html.ActionLink("My Link ®", "Action") But the output…
LFish
  • 299
  • 1
  • 6
  • 16
2
votes
1 answer

how to obsolete controller name from Html.ActionLink in mvc3

I want to obsolete controller name from Html.ActionLink because I defined my controller in route how to do this, because if I leave controller name blank in Html.ActionLink mvc3 automatically put current controller name in Action Link.
Ahsan
  • 271
  • 1
  • 8
  • 16
2
votes
1 answer

How to use/pass hidden field value in ActionLink

I have problem passing hidden field value in actionlink parameter: productView: @Html.ActionLink("ProductCompare", "ProductCompare", new { ProductIds=…
Paul
  • 457
  • 2
  • 11
  • 26
2
votes
4 answers

How to fetch the text of selected ActionLink in MVC3

I am having problem with fetching the text of the selected ActionLink I am displaying the links dynamically after fetching through database like this: @foreach (var item in Model) {
  • @Html.ActionLink(item.HobbyName, "Hobbies")
  • } Now,…
    2
    votes
    1 answer

    Is it possible to Invoke a HttpPost Action method from @Html.ActionLink?

    Is it possible to Invoke a HttpPost Action method from @Html.ActionLink ? [HttpPost] public ActionResult Delete() { // delete } @Html.ActionLink("Delete","Delete","Cart") will render an anchor tag which is a get request. I have a list of…
    Happy
    • 1,767
    • 6
    • 22
    • 26
    1
    vote
    2 answers

    MVC3 Routing Working 1 Direction Only

    I am working on an ASP.NET mvc 3 site that contains several project entities, and then each project has several associated subpages, each that works with a component of the project. So for instance, I could have a project with several photos,…
    Adam
    • 1,202
    • 11
    • 25
    1
    vote
    1 answer

    c# System.Web.Mvc.UrlHelper.GenerateUrl method have a bug?

    My English not wel, please bear with me a lot. routes in Global.asax file: routes.MapRoute("Default","{controller}/{action}/{Page}/{id}",new { controller = "Home", action = "Index", Page = 0, id = UrlParameter.Optional }); I used @Html.Action…
    LooseLive
    • 69
    • 1
    • 8
    1
    vote
    2 answers

    Html.ActionLink port setting

    How do you set up a diffrent port in public static MvcHtmlString ActionLink( this HtmlHelper htmlHelper, string linkText, string actionName, string controllerName, string protocol, string hostName, string fragment, Object…
    1
    vote
    1 answer

    Html.ActionLink sometimes doesn't redirect to the expected path

    I have the following button on my website @Html.ActionLink("Stock Manager", "Index", "StockManager", new { area = "Home" }, new { @class = "logo-stock-manager", @style = "float:left;" }) With the following method in the…
    Kermode
    • 139
    • 11
    1
    vote
    0 answers

    MVC ActionLink Error: Cannot convert from int to string

    I'm trying to pass the value that is displayed as action link to the controller as a parameter as below. @Html.ActionLink(Convert.ToInt32(@row["SerialNo"]), GetPrvsIODtls, Home, new {SerialNo = row["SerialNo"]}, null) But while Execution I get the…
    1
    vote
    2 answers

    MVC3 - Placing Role Athorization on @Html.Actionlink()

    What is the best and/or most efficient way to place Authorization on an @Html.Actionlink so so those not authrorized DO NOT SEE THE LINK.
    J0NNY ZER0
    • 707
    • 2
    • 13
    • 32
    1
    vote
    1 answer

    How to action link a route with several folders, not only controller and action?

    I know I can action link a route like this: // GET: Home [Route("Home/About/{text}/{a}/{b?}/{c?}")] public ActionResult About(string text, string a, string b, string c) { ViewBag.Message = text + a + b + c; return View(); …
    1
    vote
    1 answer

    passing parameter through @Html.ActionLink in asp.net core mvc

    First of all I would like to clarify that I am fully aware that there are many similar questions but none of them worked for me. I am trying to user @Html.ActionLink in my ASP.NET Core 3.1 MVC application. I am receiving an id from the controller…
    Mill3r
    • 544
    • 1
    • 10
    • 31
    1
    vote
    1 answer

    Asp.Net MVC 2 Html.ActionLink foreign language encoding

    when i call <%= Html.ActionLink("abcáí", "Index") %> in my view, it generates this html output: abcáí but I need not to escape the foreign characters áí, so I want the output to be abcáí My problem is not…
    Petr
    • 11
    • 2
    1
    vote
    1 answer

    parameter problem in asp.net mvc

    I'm new to asp.net mvc. I have index method with parameter id : public ActionResult Index(int id) { var dc = new ServicesDataContext(); var query = (from m in dc.Mapings where m.CustomerID == id …
    Sayamima
    • 205
    • 1
    • 8
    • 24