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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:58:55+00:00 2026-05-23T01:58:55+00:00

I have a dropdownlist in my asp.net MVC2 view like this: <% using(Html.BeginForm(temp,Settings)){ %>

  • 0

I have a dropdownlist in my asp.net MVC2 view like this:

<% using(Html.BeginForm("temp","Settings")){ %>
    <%= Html.DropDownList("drpFields", new SelectList(Model.Fields, "FieldID", "NiceName", whiteout.FieldID)) 
}
%>

and I want to pass the dropdown selected value from view to controller action. How do I modify this:

 <a class="icon-button-success" href='<%: Url.Action("EditWhiteOut", "Settings", new {FieldId = 1}) %>'>
     <img src='<%: Url.Content("~/static/Images/update.png") %>' alt="Update" />
 </a>

I want to pass dropdown’s selected value to FieldId.

  • 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-23T01:58:56+00:00Added an answer on May 23, 2026 at 1:58 am

    If you’re willing to use Ajax, you can avoid the form if you want to use jQuery.ajax. You might want to give your anchor a value for its ID property (my example below only uses its class attribute)

    But, since you want to do a regular postback, you’ll want to use another overload of Html.BeginForm so you can specify an ID attribute for the form (I specified the parameter names in case you’re unfamiliar with this overload)

    Html.BeginForm(actionName: "temp", controllerName: "Settings", 
        method: FormMethod.POST, htmlAttributes: new { id = "MyForm" })
    

    And the jQuery used to make your link submit the form will create a standard submit. So, as long as your select list has a name attribute, it’s value will be included in the post’s payload.

    $(function () {
        $('.icon-button-success').click(function (e) {
            $('#MyForm').submit();
            // you might not need preventDefault, but I can't remember if 
            // it will create a second post or not
            e.preventDefault();
        });
    });
    

    If you wanted to do a redirect anyway (using the $.ajax method), you could always do window.location.href='redirect/link'; inside the success function in the $.ajax call

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

Sidebar

Related Questions

I am using asp.net mvc 2.0(default binding model) and I have this problem. I
This is in ASP.NET. We are using a ExtJS frontend, and have our own
I have this ASP.NET code: <asp:DropDownList ID=ddlBrokers runat=server AutoPostBack=true DataSourceID=srcBrokers DataTextField=broker DataValueField=brokerId /> <asp:ObjectDataSource
Is there anyway to have items in an ASP.NET DropDownList have either their Text
I have a asp.net 2.0 web site with numerous asp:DropDownList controls. The DropDownList control
What's the best method for handling a situation where you have an ASP.Net Dropdownlist
I have an ASP.NET GridView with a DropDownList (in an Item Template) and a
I have a this aspx-code: (sample) <asp:DropDownList runat=server ID=ddList1></asp:DropDownList> With this codebehind: List<System.Web.UI.WebControls.ListItem> colors
I am using ASP.NET MVC2 and Entity Framework. I am going to simplify the
I have a dropdownlist (asp.net) and when user change the selection and i want

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.