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 1061415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:28:14+00:00 2026-05-16T18:28:14+00:00

The name is pretty confusing probably. I have a requirement where a URL must

  • 0

The name is pretty confusing probably. I have a requirement where a URL must be name friendly to represent dates (schedule/today, schedule/tomorrow etc). I don’t want to clutter my route mappings with DateTime.Now, DateTime.Now.AddDays(1) etc for different parameters so I decided to create routes that map to an action of the same name:

routes.MapRoute(RouteNames.ScheduleToday, "schedule/today", new { controller = "Schedule", action = "Today" });
routes.MapRoute(RouteNames.ScheduleTomorrow, "schedule/tomorrow", new { controller = "Schedule", action = "Tomorrow" });

The idea for the actions is that I’d like to be able to call the Today() action but actually call the List(DateTime date) action with, for example, DateTime.Now as the date parameter.

This works great like this:

public ActionResult Today()
{
    return this.List(DateTime.Now);
}

public ViewResult List(DateTime date)
{
    this.ViewData["Date"] = date;
    return this.View("List");
}

I’d like to be able to call this.View() instead of this.View("List"). Is this possible other than what I’ve posted above? It seems as though the view that is rendered matches the name of the first action that is called since the only way to get this to work is to explicitly render the List view.

  • 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. Editorial Team
    Editorial Team
    2026-05-16T18:28:14+00:00Added an answer on May 16, 2026 at 6:28 pm

    I still can’t find why the first action that is called matches the view and not the last action (perhaps I’ll dig into the source). For the time being I’ll stick with what I have since there’s no reason to over-complicate things.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've had to do some introspection in python and it wasn't pretty: name =
I have been using PRETTY_FUNCTION to output the current function name, however I have
For anyone that remembers the protocol Avatar, (I'm pretty sure this was it's name)
Name of the option tells something but what Visual Studio/compiler really do and what
Name the design considerations in deciding between use of a singleton versus a static
The name of a temporary table such as #t1 can be determined using select
How do I name a browser window in ROR, such that I can open
class Tag(models.Model): name = models.CharField(maxlength=100) class Blog(models.Model): name = models.CharField(maxlength=100) tags = models.ManyToManyField(Tag) Simple
Could somebody please name a few. I could given time, but this is for
I am pretty much set on using the Java package naming convention of com.website.app.whatever

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.