A problem with overloading an action in ASP.NET MVC -
how should global.asax file , controller's action process 2 types of url:
http://.../search http://.../search?q=abc&p=1&...&...&...& (many parameters, have list of them in global.asax file ?) ?
no, don't have list them in global.asax file, have them optional parameters in action.
e.g.
public actionresult search(string q, int page = 1, string country = "", etc etc) if you're not able use default values, make them nullable.
e.g.
public actionresult search(string q, int? page, string country, etc etc) savvy?
hths,
charles
Comments
Post a Comment