Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the asp:DropDownList client side events?

Tags:

I want to know the client side events (like onChange) for an asp:DropDownList.

like image 723
ASD Avatar asked Aug 10 '09 06:08

ASD


People also ask

What is ASP DropDownList?

The DropDownList control is a web server element that creates the drop-down menu and lets users select a single item from various options. You can add any number of items to the DropDownList. Almost all web pages contain a drop-down list, but it is mostly present in registration forms or sign-in pages.

What is AutoPostBack in DropDownList in asp net?

Those of you who worked with ASP.NET web forms will recollect that certain server controls such as DropDownList have a property called AutoPostBack. This property when set to true automatically submits the form to the server whenever the selection changes and raises some server side event.


Video Answer


2 Answers

Are you talking about ASP app? This app produces HTML code so you have all HTML events available, which for the select tag (select is a HTML tag for dropdown lists) are the following:

  • onchange
  • onclick
  • ondblclick
  • onmousedown
  • onmouseup
  • onmouseover
  • onmousemove
  • onmouseout
  • onkeypress
  • onkeydown
  • onkeyup
  • onfocus
  • onblur
like image 55
RaYell Avatar answered Feb 24 '23 14:02

RaYell


You can assign the onchange client-side event to a DropDownList control programmatically:

DropDownListID.Attributes["onchange"] = "javaScriptFunction();"; 

Give a look to this article:

  • Working with Client-Side Script
like image 42
Christian C. Salvadó Avatar answered Feb 24 '23 14:02

Christian C. Salvadó