View previous topic :: View next topic |
Author |
Message |
Stacy
Joined: 12 Oct 2004 Posts: 9
|
Posted: Tue Oct 12, 2004 11:07 am Post subject: Adding JavaScript to ASP.NET dropdowns? |
|
|
I have a number of ASP.NET dropdownlists in one of my ASP.NET pages. Is it possible to add JavaScript for the onchange events for those dropdowns?
Your help is highly appreciated,
Stacy |
|
Back to top |
|
|
administrator Site Admin
Joined: 01 Oct 2004 Posts: 183
|
Posted: Tue Oct 12, 2004 12:26 pm Post subject: |
|
|
Stacy,
You can use Attributes.Add, to add javascript event handler for your ASP.NET dropdowns:
Code: |
ddl_Your_Dropdown_List.Attributes.Add("OnChange", "alert('It worked!');"); |
_________________ Peter
ASP & ASP.NET Articles and Tutorials |
|
Back to top |
|
|
Stacy
Joined: 12 Oct 2004 Posts: 9
|
Posted: Tue Oct 12, 2004 2:43 pm Post subject: |
|
|
It worked indeed! Attributes.Add was exactly what I was looking for.
Thanks,
Stacy |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|