Sunday, 18 August 2013

MVC4 Routes issues when searching parameters are null or blank

MVC4 Routes issues when searching parameters are null or blank

I am facing the issue with routes and showing exception. it is due to when
parameters are null or blank - here when title is blank then issue.
Issue URL :
http://{ParentURL}/Admin/Menu/AddEdit/299921b2-3d7b-4e0a-b23e-5838f9b78654/1
- when Title is blank
Working Fine URL :
http://{ParentURL}/Admin/Menu/AddEdit/Test/299921b2-3d7b-4e0a-b23e-5838f9b78654/1
-> Here Test Is Title
context.MapRoute(
"AdminOperation",
"Admin/{controller}/{action}/{title}/{id}/{pageno}",
new { action = "AddEdit", id = UrlParameter.Optional,
pageno = UrlParameter.Optional, title =
UrlParameter.Optional }
);
please help me on it.
Regards

No comments:

Post a Comment