Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to switch to "View"?

$
0
0

Question.
1. What HTML page elements to use to follow links to other View?
Example.
1.1 - <a> </a>
1.2 - <input type = "submit" name = "name" value = "submit_1" />
1.3 - <button> </button>
others?
 
2. What principles are used to switch to View?
What are the most effective principles?
What are the most preferred principles?
 
Example.
2.1 Follow direct links (href = "~ / Views / View1 /");
2.2 Transition using the controller method;
I understand correctly?
 
3. Ways to click on the links?
What are the most effective ways?
What are the most preferred methods?
Example.
3.1 - href;
3.2 - tag-helpers;
others?
 
4. Is it possible to place several `View` in the folder of one controller?
Example \ Home \ View0.cshtml;
 
Description.
I understand that the question is probably wide, so at least I will be grateful for a short answer to the question.
Please apply the answer to my project structure.
Browse Pages:
 - \ Home \ View0.cshtml;
 - \ View1 \ Index.cshtml.
 
Code (my attempts).

HomeController.cs

using Microsoft.AspNetCore.Mvc;

namespace WebAppCore.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}

public ActionResult View1()
{
return View();
}

public ActionResult View2()
{
return View();
}


}
}

\Home\Index.cshtml

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers<h1> *** Test View Main ***</h1><h2> *** From the box ***</h2><a href="~/Views/View1/">A_View1</a><input type="submit" name="name" value="submit_1" /><button>button_1</button><h2> *** Tag hepler ***</h2><a asp-action="View1">A_action</a><a action="View1">A_action</a><button asp-action="View1">button_1_1</button>


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>