Home > Backend Development > C++ > How to Link to a Method in a Different Controller Using HTML.ActionLink?

How to Link to a Method in a Different Controller Using HTML.ActionLink?

DDD
Release: 2025-01-22 12:51:31
Original
977 people have browsed it

How to Link to a Method in a Different Controller Using HTML.ActionLink?

How to Use HTML.ActionLink to Create a Link to a Method in a Different Controller?

Suppose you have a class like the following:

public class ItemController:Controller<br>{</p>
<div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="brush:php;toolbar:false">public ActionResult Login(int id)
{
    return View("Hi", id);
}
Copy after login

}

If you want to create a link to the Login method from a page that is not located in the Item folder, where ItemController resides, you can use the HTML.ActionLink method with the following parameters:

ASP.NET MVC1

Html.ActionLink(article.

The above is the detailed content of How to Link to a Method in a Different Controller Using HTML.ActionLink?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template