我正在开发一个名为“Student”和“Profile”的两个控制器的项目。
public class StudentController : Controller
{
public ActionResult Login(){}
public ActionResult Home(){}
}
public class ProfileController : Controller
{
public ActionResult Details(){}
}
登录后当我在我的主页时,它会给我以下网址
url:http://localhost:3451/Student/Home?username=student%40gmail.com
当我点击基于Ajax的Profile链接时,请在下面
@Ajax.ActionLink(" ", "Details", "Profile",
new { username = Session["username"].ToString() },
new AjaxOptions()
{
UpdateTargetId = "ajax",
InsertionMode = InsertionMode.Replace,
HttpMethod = "POST",
OnSuccess = "changeUrl(data)" },
new { @class = "glyphicon glyphicon-user",
title = "Profile", style = "color:white;"
})
给了我学生档案,但网址仍然相同,但我想要更改这样的网址
url:http://localhost:3451/Profile/Details/