Can I override an ActionResult method. Say I have a method Index in AccountController like this
public ActionResult Index()
{
return View();
}
Can I have one more method with same name but with differnt parameters
like
public ActionResult Index(int userid)
{
return View();
}
I dont want to call it like http://something/accounts/index/11
I just want to say http://something/accounts/11
You can look at stackoverflow stuff also
if you go to https://stackoverflow.com/users
i feel users is the controller and the default action is index so dont to call it explicit.
now if you type something like https://stackoverflow.com/users/96346/parminder
the two parameters are 96346 and parminder
I hope it makes sense.
what will be the entries in the global.asax
Regards
Parminder
Take a look at my question here
I think you can do it by hacking some method attributes but I think it would be cleaner if you write another method then add a route for it.It would look like this:
Then you provide a route for it like: