Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 127225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:26:34+00:00 2026-05-11T05:26:34+00:00

I am currently creating a mobile version of my company’s site and using it

  • 0

I am currently creating a mobile version of my company’s site and using it as a time to learn asp.net mvc.

The URLs which I’m meant to be creating are as follows

Jobs/in/location
Jobs/for/jobTitle
Jobs/in/location/for/jobtitle
jobs/for/jobtitle/in/location

Now the more types we add the more I’ll need to add and different routes I’ll need, so not really maintaining.

So currently in my Global.asax.cs is

   //Jobs             routes.MapRoute(                 'DefaultJobs',                                              // Route name                 'Jobs/{pagenumber}',                           // URL with parameters                 new { controller = 'Jobs', action = 'Default', pagenumber = '1' }  // Parameter defaults             );              //Jobs by Location              routes.MapRoute(                 'JobsByLocation',                                              // Route name                 'Jobs/in/{location}/{pagenumber}',                           // URL with parameters                 new { controller = 'Jobs', action = 'Default', location = '', pagenumber = '1' }  // Parameter defaults             );              //Jobs by Title              routes.MapRoute(                 'JobsByTitle',                                              // Route name                 'Jobs/for/{title}/{pagenumber}',                           // URL with parameters                 new { controller = 'Jobs', action = 'Default', title= '', pagenumber = '1' }  // Parameter defaults             );              //Jobs by Title and Location              routes.MapRoute(                 'JobsByTitleAndLocation',                                              // Route name                 'Jobs/for/{title}/in/{location}/{pagenumber}',                           // URL with parameters                 new { controller = 'Jobs', action = 'Default', location = '', title = '', pagenumber = '1' }  // Parameter defaults             );  

So I’m not sure if this is right, since in my JobsController I did have ‘in’ as a Controller, but I could only get one parameter. So I went with a default one which caught everything.

 public ActionResult Default(string location, string title, string pagenumber)         {             return Content('Location ' + location + ' Title ' + title + ' Page ' + pagenumber);         } 

Now is this the right way of doing it? Or have I missed something?

For calling this method, I have this

 [AcceptVerbs(HttpVerbs.Post)]         public ActionResult SearchContinent(string Continents)         {             try             {                 // TODO: Add update logic here                  //return RedirectToAction('Default','Jobs',                     //new {                        // location = Continents                         // });                   return RedirectToRoute(new { controller = 'Jobs', action = 'Default', location = Continents, pagenumber = '1' });                   //return Redirect('Jobs/in/' + Continents);             }             catch             {                 return View();             }         } 

Now this doesn’t produce the correct url since it is missing the ‘in’ and passes ‘location’ as a param, which works but is incorrect.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:26:35+00:00Added an answer on May 11, 2026 at 5:26 am

    With RedirectToRoute you should pass the route name you’re targetting, so:

    return RedirectToRoute('JobsByLocation', new { location = Continents, pagenumber = '1' }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I'm currently creating a mobile site for a business. And I wanted to
I am creating a site which will have a desktop and a mobile theme.
I am currently creating a mobile application. I am using cakephp2.0 as my backend
I'm making a mobile site using Dashcode to help me creating better UIs, but
im currently creating a graph for an app, using coreplot and have a problem
Im currently creating a tile-based game for android. Using java via dalvik JVM. im
I am currently creating a hybrid mobile app (see phonegap/cordova) for iOS and Android
I am currently building a game in phonegap using jQuery Mobile frame work. What
I'm in the process of creating a responsive site (currently only working on the
I am creating an MVC mobile application. One of my screens contains radio buttons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.