473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

A question about DropDownList (fire Actions after an OnChange event)

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:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <Items>
  3.   <Item ID="1" Name="MVC" Country="England" City="London" Website="http://forums.asp.net" Genre="New" />
  4.    ....
  5. </Items>
... and a Index.page like this:
Expand|Select|Wrap|Line Numbers
  1. <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  2.     <h2>Hitdossier</h2>
  3.     <script type="text/javascript">
  4.         function OnChange(text) {
  5.             ...
  6.         }
  7.     </script>
  8.     <form id="form1" runat="server">
  9.         <br />
  10.         <label>Select Name</label>
  11.         <%= Html.DropDownListFor(a => a.SelectedItem, new SelectList(Model.Artists, "Value", "Text"), new { onchange = "OnChange(this.Value);" })%>
  12.  
  13.         <br />
  14.         <br />
  15.         <%= Html.Action("DetailInfo") %><br />
  16.         <br />
  17.         <%= Html.Action("MemberList") %> <br />
  18.         <br />
  19.         <%= Html.Action("RelationsList") %><br />
  20.         <br />
  21.     </form>
  22. </asp:Content>
My question is: How can I fire Html.Actions after an OnChange event by using an ID?

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

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

Country: England

City: London

Website: etc.

... and then a list of Members and Relations.

Thank you for helping me

Wesley
Jul 17 '12 #1
0 1538

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Asit | last post by:
In JavaScripts checks for an onChange event against the value of the textbox at the time of the last onChange event. Since an onChange Event never fired after you changed the text first time ,...
4
by: Zeebra3 | last post by:
Here goes: I have a web form with several asp:dropdownlists, with which, when selection is changed I want to fire an event defined in some clientside js. The content of the clientside code is...
1
by: Chris Ashley | last post by:
I'm using the javascript onchange event in a few places but it's behaviour isn't as expected. In order for this event to fire after changing text in a textbox, the user needs to either tab out of...
4
by: David McNerney | last post by:
Would anyone be able to tell me why I get an error in FireFox 1.5.0.1 for MacOSX when I type some text and hit Enter in the following form: <html> <body> <form action="http://example.com"...
1
by: Steve | last post by:
hi all any body has any idea on how to fire onchange event of a pulldown menu with script. i need to trigger it so it when i select a certain option from script,the event handler is executed
2
by: William Cole | last post by:
Here is my issue I have two text fields (Field A, Field B). I want Field B to be updated when Field A is changed. The problem is Field A is being changed through JavaScript so an onChange event...
1
by: langdale | last post by:
I am using a popup calendar to populate an input field. When the contents of this field change I need the onChange event to fire so that I can perform further updates. The onChange event...
2
by: John Kotuby | last post by:
Hi all, In ASP.NET 2.0 and VB.NET, I am trying to get the OnSelectedIndexChanged event to fire a Javascript function. There is no OnClientClick event for that control. When I try something...
0
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.