Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 访问不同文件夹中的页面_C#_.net_Asp.net Mvc - Fatal编程技术网

C# 访问不同文件夹中的页面

C# 访问不同文件夹中的页面,c#,.net,asp.net-mvc,C#,.net,Asp.net Mvc,我的主文件夹中的一个视图中有这一行 @Html.ActionLink("Edit", "Edit", new { id = item.ResearcherID }) 当我单击时,它将带我到主页/编辑/id 但是,我的编辑页面位于“研究人员/编辑”中 我试着做: @Html.ActionLink("Edit", "Researchers","Edit", new { id = item.ResearcherID }) 但它把我带到了这一页 如何链接到所需页面?研究人员编辑页面是研究人员控制器的

我的主文件夹中的一个视图中有这一行

@Html.ActionLink("Edit", "Edit", new { id = item.ResearcherID })
当我单击时,它将带我到主页/编辑/id

但是,我的编辑页面位于“研究人员/编辑”中

我试着做:

@Html.ActionLink("Edit", "Researchers","Edit", new { id = item.ResearcherID })
但它把我带到了这一页


如何链接到所需页面?

研究人员编辑页面是
研究人员
控制器的一部分。在
ActionLink()
调用中指定
Edit
控制器的操作

@Html.ActionLink("Edit", "Edit", "Researchers", new { id = item.ResearcherID }, null)


如果这是控制器
试试这个:@Html.ActionLink(“编辑”、“编辑”、“研究人员”,new{id=item.ResearcherID})

谢谢您的编辑!现在效果很好@ActionLink(“编辑”、“编辑”、“研究者”,null,新的{id=item.ResearcherID})刚刚指向研究者/edit@Viktor如果答案正确,一定要接受。
public static MvcHtmlString ActionLink(
    this HtmlHelper htmlHelper,
    string linkText,
    string actionName,
    string controllerName,
    object routeValues,
    object htmlAttributes
)