Action method is not fired after deploying in IIS using Ajax.ActionLink()
I have a default routing as below:
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "URLParameter.Optional" } // Parameter defaults
);
}
My Index Action method is returning a list of model to view. And in Index View i have somthing like this:
@Html.ActionLink(article.Title,"Download",new { id = "C:Filesfile1.txt"},null);
But, AFter deploying in IIS the "Download" action method is not getting fired And getting a 404 PAGE NOT FOUND error.
If I am specifing the action method as 'Index" in Html.ActionLink, Then It's working Like:
@Html.ActionLink(article.Title,"Index",new { id = "C:Filesfile1.txt"},null);
The Above code is working because it's taking the default route after deploying in IIS. I tried to change the routes in Global.asax, But failed to get a solution.
What i need here is, I want the second action method to be fired, which is not.
My 1st Action Method is :
public ActionResult Index() {}
My 2nd Action Method is :
public ActionResult Download(string loc) {} //This is not getting fired..???
Will provide you more details if needed..please Assist, as it will effect my delivery.
链接地址: http://www.djcxy.com/p/49990.html