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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:32:14+00:00 2026-06-08T01:32:14+00:00

I have a MVC website. And in a page there is a dropdownlist, a

  • 0

I have a MVC website. And in a page there is a dropdownlist, a detailinfo-view and several list-views.

The data comes from imported XML-files such like:

<?xml version="1.0" encoding="utf-8" ?>
<Items>
  <Item ID="1" Name="MVC" Country="Engeland" City="London" 
        Website="http://forums.asp.net" Genre="New" />
   ....
</Items>

Index.page

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function OnChange(text) {
            ...
        }
    </script>

    <form id="form1" runat="server">
        <br />
        <label>Select Name</label>
        <br />
        <%= Html.DropDownListFor(a => a.SelectedItem, 
                new SelectList(Model.Artists, "Value", "Text"), 
                new { onchange = "OnChange(this.Value);" })%>
        <br />
        <br />
        <%= Html.Action("DetailInfo") %><br />
        <br />
        <%= Html.Action("MemberList") %> <br />
        <br />
        <%= Html.Action("RelationsList") %><br />
        <br />
    </form>
</asp:Content>

My question is: How can I reuse Html.Actions after an OnChange event by selecting an item in a DropDownList?

I want to change the view data when the item of a dropdownlist has changed.

I hope to see on the webpage, detail information right under the DropDownList.

Country: England

City: London

Website: etc.

Then a list of Members and Relations.

Thank you for helping me

Wesley

  • 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-06-08T01:32:16+00:00Added an answer on June 8, 2026 at 1:32 am

    So you mean I place an onchange event in my Controller

       <script type="text/javascript">
        $(document).ready(function() {
                var AID = 810000;
                function OnChange(action, value) {
                    $.load( action, {AID: value});
            }
        });
        </script>
    

    And in the Index.aspx do I write:

     <%using (Ajax.BeginForm("OnChange", "MainController",
              new AjaxOptions { HttpMethod = "Post" }))
             {%>
            <%= Html.DropDownListFor(a => a.SelectedID, 
                    new SelectList(Model.Artiesten, "Value", "Text"),
            new
            {
                onchange = @"
                var form = document.forms[0]; 
                form.action='OnChange(../Controllers/MainController/OnChange, Value)' ;
                form.submit();"
            })%>
        <%} %> <br />
    

    … and in the MainController there is a method

    [HttpPost]
    protected void OnChange(int? AID)
    {
       int iID = AID ?? 810000;
    
       DetailInfo (AID);
       MemberList(AID);
       RelationsList(AID);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET MVC page. I Configured a IIS Website and added the
I have an ASP.NET MVC website where I've established a system of Permissions. There
I have the following view definition in my asp.net mvc website: <% Using Ajax.BeginForm(UsrCtlChangePassword,
MVC website- On the home page header section, I have a drop down with
I have a single-page JavaScript application, held within an ASP.NET MVC 3 website. In
I'm working on an ASP MVC website and have encountered a problem. The page
The website is build with Codeigniter MVC framework. I have a page that is
Say I have an asp.net mvc website with a page that lists products. ON
i have an asp.net mvc website where i build up most of the page
I have a MVC website that sits on top of a WCF service. The

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.