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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:07:11+00:00 2026-05-23T11:07:11+00:00

How do I get the complete request URL (including query string) in my controller?

  • 0

How do I get the complete request URL (including query string) in my controller? Is it a matter of concatenating my URL and form parameters or is there a better way.

I checked this question, but it seems not to be applicable to MVC.

Correct me if I’m wrong.

Some more detailed information:

My call to my SearchController.AdvancedSearch() originates from a form with about 15 optional parameters. Because of the number of parameters and no possible way (I think) to have optional parameters passed in a clean way, I went for a catchall string that is handled in the controller.

Now I want my controller to store its call in a breadcrumb component so that when the crumb is clicked the exact same result can be fetched (with all, but not more, of the arguments included). To do this I need the entire request.URL, including the querystring.

In Request.RawURL, request.URL etc this query string is not included. In fact currently I do a plain function.

String.Format("{0}/{1}", request.Url, request.form)

This gives me some weird results (like submit button values etc), but it works. If there are suggestions on how to make this less of an ugly hack, please do tell.

I know where to find the current request, but I can’t seem to find a raw URL anywhere though. They are all deprived from the querystring and I need that bit too.

My controller updates a collection of URLs in my BreadCrumb component. Therefore it needs the request URL. How do you suggest I take on this problem?

  • 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-23T11:07:12+00:00Added an answer on May 23, 2026 at 11:07 am

    You can use Request.Url.PathAndQuery.

    MVC5: use Request.RequestUri.PathAndQuery

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

Sidebar

Related Questions

Is there a simple way in .NET to quickly get the current protocol, host,
Possible Duplicate: How to get Url Hash (#) from server side c# get complete
What exactly is DOM Load time? Is it time to just get complete html
Can I get a complete simple scenario i.e. tutorial that suggest how this should
From Java, is it possible to get the complete commandline with all arguments that
I get a .pdf complete with images, fancy fonts, styles, gradients and what have
How do I get a a complete list of all the urls that my
I need a python script to perform a GET request on 2 urls. I
here's the problem: when requesting url like - http://server/path/to/file.html?param=../../something/something i get response: 500 Internal
I am using a $.get request to get some data and am then storing

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.