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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:05:57+00:00 2026-05-26T04:05:57+00:00

Background: I have an MVC layout (master) view which uses @Html.RenderAction to display a

  • 0

Background:

I have an MVC layout (master) view which uses @Html.RenderAction to display a dropdown in the left side navigation panel. This dropdown will be displayed on all the pages of the site.
The dropdown is wrapped in a form element and on change of the dropdown the form is posted.

Question:

Now, once the form is posted, I need to reload the contents of the current page (whatever page the user is currently on…) with the value of the dropdown attached in the querystring. This would mean replacing the value which might already be there in the querystring from a previous selection.

Example:

  1. The user navigates to the Home page of the website:

Url: /Home/?dropdownvalue=blue

At this point the dropdown displays ‘Blue’ as selected. The user changes the value in the dropdown to ‘Red’. I need to reload the page with the following url –

/Home/?dropdownvalue=red

  1. The user moves to another page in the site:

Url: /CustomerFavorite/?dropdown=red

Change the value in the dropdown from ‘Red’ to ‘Green’.

The ‘CustomerFavourite’ page should be reloaded with ‘Green’ in querystring.

I apologize for the lenghty post. But, thought of providing some extra information to clarify the issue.

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-26T04:05:57+00:00Added an answer on May 26, 2026 at 4:05 am

    Thanks to Darin for providing the link for javascript manipulation of the querystring. But, I wanted a server side solution so here’s how I implemented it –

    public ActionResult _ColorSelection(ColorModel model)
    {
        string selectedColor = model.Color.Value;
    
        // Modify Querystring params...
    
        NameValueCollection querystring = 
                HttpUtility.ParseQueryString(Request.UrlReferrer.Query); // Parse QS
    
        // If Querystring contains the 'color' param, then set it to selected value
        if (!string.IsNullOrEmpty(querystring["color"]))
        {
            querystring["color"] = selectedColor;
        }
        else  // Add color key to querystring
        {
            querystring.Add("color", selectedColor);
        }
    
        // Create new url
        string url = Request.UrlReferrer.AbsolutePath 
                             + "?" + querystring.ToString();
    
        return Redirect(url); // redirect
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple layout with Html and CSS which is like below
Background: I have an ASP.NET MVC view page with a MultiSelectList in the View
Background I have a page on my ASP.NET MVC web app for users to
background:Me and my coworkers are working on asp.net mvc project ... we have a
Background: we have an application that generates reports from HTML (that may or may
Background: I have a module which declares a number of instance methods module UsefulThings
First some brief background: I have an existing ASP.NET MVC 1 application using Entity
I have an ASP.NET MVC site (Master Page + Content pages). On the master
Why the favicon disappears Background: I have my site made according to mvc So,
I have a mvc view made up of a matrix of radio buttons. Each

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.