相关疑难解决方法(0)

使用"RedirectToAction"从控制器重定向到哈希

您好我想从Mvc Controller返回一个锚点

控制器名称= DefaultController;

public ActionResult MyAction(int id)
{
        return RedirectToAction("Index", "region")
}
Run Code Online (Sandbox Code Playgroud)

这样,当指向索引时,url是

http://localhost/Default/#region
Run Code Online (Sandbox Code Playgroud)

以便

<a href=#region>the content should be focus here</a>
Run Code Online (Sandbox Code Playgroud)

我不是问你是否可以这样做:我如何在我的URL中添加锚标记?

asp.net-mvc asp.net-mvc-3 asp.net-mvc-4

84
推荐指数
4
解决办法
2万
查看次数

标签 统计

asp.net-mvc ×1

asp.net-mvc-3 ×1

asp.net-mvc-4 ×1