Answered by:
Write custom mapRoute in mvc 4

Question
-
Hi,
Due to some instruction, I have to create a custom routeurl like http://localhost:1231/person/?personid=12345&uid=87
Can anybody help me to write a custom mapRoute for this..
Thanks in advance.
Learner_Geek
mLearner
- Moved by Dave PatrickMVP Thursday, January 22, 2015 1:14 AM
Wednesday, January 21, 2015 2:51 PM
Answers
-
This one may help.
http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/creating-custom-routes-cs
or try asking here.
http://forums.asp.net/1146.aspx/1?MVC
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Thursday, January 22, 2015 1:28 AM
- Marked as answer by Just Karl Friday, January 30, 2015 6:41 PM
Thursday, January 22, 2015 1:14 AM
All replies
-
This one may help.
http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/creating-custom-routes-cs
or try asking here.
http://forums.asp.net/1146.aspx/1?MVC
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Thursday, January 22, 2015 1:28 AM
- Marked as answer by Just Karl Friday, January 30, 2015 6:41 PM
Thursday, January 22, 2015 1:14 AM -
Hi,
Thanks for the reply but i think my question was not clear so ill try to explain it again..
I'm sitting in contoller web method i.e( Index) and want to redirect to other method (Save) and wanted that when i get values in (Save method) its url should be like http://localhost:1231/person/?personid=12345&uid=87
i know it is not best t use such kind of url in mvc but it my requirement due to third party tool sharing..
So my question is when i use redirecttoaction webmethod and passing these two parameter and in response i should get url like http://localhost:1231save/?personid=12345&uid=87 but now it is coming like http://localhost:1231/save/12345/87 which i dont want.
I hope now i have explained more..
Thanks in advance
m_Learner
- Edited by m_Learner Friday, January 23, 2015 12:20 PM
Friday, January 23, 2015 12:11 PM -
This is "Where Is" forum. You'll need to re-ask over here as it is a different platform where we can not move it.
http://forums.asp.net/1146.aspx/1?MVC
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.Friday, January 23, 2015 4:38 PM