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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:34:51+00:00 2026-05-21T22:34:51+00:00

I’m working on the http://mvcforum.codeplex.com project. We have 2 areas, Forum and ForumAdmin. I

  • 0

I’m working on the http://mvcforum.codeplex.com project.

We have 2 areas, Forum and ForumAdmin.

I have a few named routes, to make a nice URL with forum/topic titles in the URL:

context.MapRoute("ShowTopic", "Forum/Topic/{id}/{title}", new { controller = "Topic", action = "Index" });
context.MapRoute("ShowForum", "Forum/Forum/{id}/{title}", new { controller = "Forum", action = "Index" });
context.MapRoute("ShowCategory", "Forum/Category/{id}/{title}", new { controller = "Category", action = "Index" });

context.MapRoute(
    "Forum_default",
    "Forum/{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    new string[] { "mvcForum.Web.Areas.Forum.Controllers" }
);

So this almost works as intended. When I’m just browsing the forum everything works fine, but when I need to post a topic (Create method on the Topic controller), it fails:

The parameters dictionary contains a
null entry for parameter ‘id’ of
non-nullable type ‘System.Int32’ for
method ‘System.Web.Mvc.ActionResult
Index(Int32, System.String, Int32)’ in
‘mvcForum.Web.Areas.Forum.Controllers.ForumController’.
An optional parameter must be a
reference type, a nullable type, or be
declared as an optional parameter.
Parameter name: parameters

Which more or less boils down to not hitting the Create method, but selecting the Index method.

Any idea what it is I’m doing wrong? And what routes I should have/not have to get this working?

Thanks in advance!
Steen

  • 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-21T22:34:51+00:00Added an answer on May 21, 2026 at 10:34 pm

    The URL Forum/Topic/Create would hit the route Forum/Topic/{id}/{title}

    The problem is, the route Forum/Topic/{id}/{title} and Forum/{controller}/{action}/{id} are mostly indistinguishable (how does your route engine know that “Create” isn’t an id for the Topic route?

    As such, I don’t know any better way than declaring each action with their own route:

    context.MapRoute("CreateTopic", "Forum/Topic/Create/", 
        new { controller = "Topic", action = "Create" });
    context.MapRoute("ShowTopic", "Forum/Topic/{id}/{title}", 
        new { controller = "Topic", action = "Index" });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from

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.