c# - Why can the resource cannot be found? -
i have asp.net application following view directories.
-account -shared -layout -home -index -about -upload -uploadindex -uploadview -uploaddelete
in layout have fellowing actionlink:
<li class="navbar-links"> @html.actionlink("view uploads", "uploadindex", "upload", new { @class = "navbar-links" }) </li>
if in de home/index page go home/uploadindex. when type in de url http://localhost:12345/upload/uploadindex, actionlink upload works.
how make actionlinks works other directory other controller.
a link in mvc (i think you're using mvc) routed controller invokes view. link /upload/uploadindex
default handled method uploadindex
on uploadcontroller
.
however, @html.actionlink("view uploads", "uploadindex", "upload", new { @class = "navbar-links" })
doesn't think it's doing. resolves https://msdn.microsoft.com/en-us/library/dd492124%28v=vs.118%29.aspx , argument upload
understood parameter object routeparamters
. creates link "current" controller (in case home
), route parameter supplied "upload" (which translated query parameter length
value 6
) link /home/uploadindex?length=6
you want https://msdn.microsoft.com/en-us/library/dd504972%28v=vs.118%29.aspx
which called as
@html.actionlink("view uploads", "uploadindex", "upload", new {}, new { @class = "navbar-links" })
here third parameter controller want request routed to.
Comments
Post a Comment