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

  • Home
  • SEARCH
  • 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 3805032
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:36:46+00:00 2026-05-19T14:36:46+00:00

I’m trying to create a wizard-like workflow on a site, and I have a

  • 0

I’m trying to create a wizard-like workflow on a site, and I have a model for each one of the steps.

I have the following action methods:

public ActionResult Create();
public ActionResult Create01(Model01 m);
public ActionResult Create02(Model02 m);
public ActionResult Create03(Model03 m);

And I want the user to see the address as

/Element/Create
/Element/Create?Step=1
/Element/Create?Step=2
/Element/Create?Step=3

All the model classes inherit from a BaseModel that has a Step property.
The action methods that have the parameters have the correct AcceptVerbs constraint.

I tried naming all the methods Create, but that resulted in a AmbiguousMatchException.

What I want to do now is to create a custom route for each one of the actions, but I can’t figure out how to do it.
This is what I tried:

     routes.MapRoute(
        "ElementsCreation", 
        "Element/Create",
        new{controller="Element", action="Create01"},
        new{Step="1"}
        );

But this doesn’t work.

Any help (on the correct MapRoute call or maybe a different approach) would be greatly appreciated.

Thanks

  • 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-19T14:36:47+00:00Added an answer on May 19, 2026 at 2:36 pm

    I actually found a different approach.

    Instead of adding a new Route Map, I created a new Action Method attribute to verify if the passed request is valid for each of the action methods.

    This is the attribute class:

    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public sealed class ParameterValueMatchAttribute : ActionMethodSelectorAttribute
    {
       public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
       {
          var value = controllerContext.RequestContext.HttpContext.Request[Name];
          return (value == Value);
       }
    
       public string Value { get; set; }
       public string Name { get; set; }
    }
    

    And I have each one of the action methods with the same name and decorated like this:

    [AcceptVerbs(HttpVerbs.Post)]
    [ParameterValueMatch(Name="Step", Value="1")]
    public ActionResult Create(Model01 model)
    

    I like this approach a LOT more than creating one route for each method.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.