I want to generate URL like.. It should include two IDs with employer and job including.
I am confused and have no idea about it. I have a controller Employer.
http://localhost/Employer/[employerID]/job/[jobid]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have made a few changes to Xander’s answer. I don’t think you’ll want to use parameters here, as this will throw off other routes to other controllers/action methods. If you use the hard-coded
"Employer"and"job"strings, you will be narrowing down what routes are analyzed by this route.Also, you can’t have an optional parameter before a required parameter.