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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:11:08+00:00 2026-05-13T13:11:08+00:00

I am required to implement a simple webapp for a online competition for a

  • 0

I am required to implement a simple webapp for a online competition for a simple game.
I need to handle a Get request and respond to that.

I thought, let’s just use a bare ASP.Net MVC app, and let it handle the URL.

Problem is, the URL I need to handle is :

 http://myDomain.com/bot/?Action=DoThis&Foo=Bar

I tried:

public ActionResult Index(string Action, string Foo)
    {
        if (Action == "DoThis")
        {
            return Content("Done");
        }
        else
        {
            return Content(Action);
        }
    }

Problem is, the string Action always gets set as the action name of the route.
I always get:

Action == "Index"

It looks like ASP.Net MVC overrides the Action parameter input, and uses the actual ASP.Net MVC Action.

Since I cannot change the format of the URL that I need to handle: is there a way to retrieve the parameter correctly?

  • 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-13T13:11:09+00:00Added an answer on May 13, 2026 at 1:11 pm

    Grab the action from the QueryString, the old school way:

     string Action = Request.QueryString["Action"];
    

    Then you can run a case/if statements on it

    public ActionResult Index(string Foo)
    {
        string Action = Request.QueryString["Action"];
        if (Action == "DoThis")
        {
            return Content("Done");
        }
        else
        {
            return Content(Action);
        }
    }
    

    It’s one extra line, but it’s a very simple solution with little overhead.

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

Sidebar

Related Questions

How to implement scrolling animation? I'm ok with setting a simple AlphaAnimation that triggers
Trying to implement an Attending button. It's simple (or so I thought). A user
im writing a chrome extension and need a simple text editor component so that
I am required to implement a functionality similar to SO voting. I tried to
I'm working on a project that will require me to implement a calendar. I'm
I would like to implement an input mask on Magento and that requires the
I want to implement a terms and conditions page for my site that requires
Advice required on architecting module I have a PORT Listener that listens to a
How can I implement a form with simple components (text boxes, comboboxes) bound to
I have a fairly simple console app that monitors an exchange mailbox, picks particular

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.