I have created a view in View>Shared folder
Which has this code
@if (Request.IsAuthenticated)
{
<text>Welcome <strong>@User.Identity.Name</strong>!
@Html.ActionLink("Log Off", "LogOff", "Account", new { data_role = "button" })</text>
}
else
{
@Html.ActionLink("Log On", "LogOn", "Account", new { data_role = "button" })
}
Than I have created a controller in the controller folder
public class AccountController : Controller
{
//
// GET: /Account/
public ActionResult Index()
{
return View();
}
public ActionResult LogOn()
{
return View();
}
public ActionResult LogOff()
{
return View();
}
}
and by right click on the Index logOn and LogOff views are created in the folder
Views> Account
But when I am clicking on the Log On button I am not redirecting to the logOn page.
Please help
Do you have a route for this? Also type in the expected URL and see if you can get to it. Does it show the right url when you mouse over the link?