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
DDDOriginal
2025-01-22 12:51:31978browse

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>
<pre class="brush:php;toolbar:false">public ActionResult Login(int id)
{
    return View("Hi", id);
}

}

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:
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