如何从Url中删除空参数:
http://localhost:12058/User/Doctors?pageNumber=1&HospitalId=&DepartmentId=&specialityId=&name=&email=
就我而言,我想要来自name=&email=
我尝试这样做:
routes.MapRoute(null, "{controller}/{action}/{id}", // URL with parameters
new { controller = "User", name = UrlParameter.Optional, email = UrlParameter.Optional });
但这对我不起作用