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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T09:42:01+00:00 2026-05-19T09:42:01+00:00

I have a masterpage on which i displays groups that user can access now

  • 0

I have a masterpage on which i displays groups that user can access now i want to gets its selected value in many controllers for saving with the records. I want to know if it is possible in asp.net mvc 2 and if not then what is the way around for it

  • 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-19T09:42:02+00:00Added an answer on May 19, 2026 at 9:42 am

    What you are trying is possible and there are different techniques to achieve it. The best approach would depend on how you are invoking your controller actions. Whether you are using normal hyperlinks, submitting standard <form> or using AJAX. So if you are using standard action links you could add some javascript which binds to the onclick event of each link and adds the selected value of the group. Example:

    $(function() {
        $('a').click(function() {
            // everytime a link is clicked
            // add the value of the selected group to the url
            var selectedGroup = $('#IdOfYourDdl').val();
            if (this.href.indexOf('?') > 0) {
                window.location = this.href + '&selectedGroup=' + selectedGroup;
            } else {
                window.location = this.href + '?selectedGroup=' + selectedGroup;
            }
            // cancel the default action as it doesn't contain the selectedGroup
            // parameter in the request
            return false;
        });
    });
    

    and in your controller action you could have this additional parameter:

    public ActionResult Foo(string selectedGroup)
    {
       ...
    }
    

    Another example is if you use AJAX you could setup a default data in the master page which will ensure that the value of the dropdown will be sent along each AJAX request you are performing:

    $.ajaxSetup({
        data: { selectedGroup: $('#IdOfYourDdl').val() }
    });
    

    Now whenever you send an AJAX request to your server:

    $.get('/foo', { someParam: 'someValue' }, function(result) {
    
    });
    

    the following request will be sent: /foo?someParam=someValue&selectedGroup=123 so you will be able to fetch the value of the selected group back in the controller action.

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

Sidebar

Related Questions

I have a MainPage.Master and another ContentPage.Master which uses MainPage.master as its masterpage (
I have a MasterPage, with my Usercontrol inside a div. I can set visible=false
I have a treeview in my masterpage. When a contentpage is loaded i want
I have several aspx pages that can be opened either normally (full screen in
I have a master page which all my views inherit from. The issue I
I have 2 references to jQuery in my master page which is currently configured
I have to find the IDs of all the contentPlaceHolders in a MasterPage.
The basic idea of a masterpage is simple -- you have a block of
I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)
I have some pages that have content that is relevant to both logged in

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.