PC Review


Reply
Thread Tools Rate Thread

asp:DropDownList

 
 
OldButStillLearning
Guest
Posts: n/a
 
      16th Jan 2008
If I want to hang javascript off of an aspropDownList control, how would I
do this? There does not seem to be a "onchange" event so do I have to use
an HTML control to do this?
 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      16th Jan 2008
myDdl.Attributes["onchange"] = "myJavascriptFunction()";

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


"OldButStillLearning" <(E-Mail Removed)> wrote
in message news:47FB6976-D408-475D-8B43-(E-Mail Removed)...
> If I want to hang javascript off of an aspropDownList control, how would
> I
> do this? There does not seem to be a "onchange" event so do I have to
> use
> an HTML control to do this?


 
Reply With Quote
 
grava
Guest
Posts: n/a
 
      17th Jan 2008


"Eliyahu Goldin" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> myDdl.Attributes["onchange"] = "myJavascriptFunction()";
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
>
>
> "OldButStillLearning" <(E-Mail Removed)>
> wrote in message
> news:47FB6976-D408-475D-8B43-(E-Mail Removed)...
>> If I want to hang javascript off of an aspropDownList control, how
>> would I
>> do this? There does not seem to be a "onchange" event so do I have to
>> use
>> an HTML control to do this?

>


If I remember well you have to put this code before Page_Load ... Page_Init
is one accepted place.

HTH


--
Gianluca Gravina
http://blogs.ugidotnet.org/thinkingingrava

 
Reply With Quote
 
Eliyahu Goldin
Guest
Posts: n/a
 
      17th Jan 2008
That is true for dynamically created controls. Dynamically created
attributes can be added in Page_Load.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"grava" <(E-Mail Removed)> wrote in message
news:2840ED34-3393-460C-BB1E-(E-Mail Removed)...
>
>
> "Eliyahu Goldin" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> myDdl.Attributes["onchange"] = "myJavascriptFunction()";
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>>
>>
>> "OldButStillLearning" <(E-Mail Removed)>
>> wrote in message
>> news:47FB6976-D408-475D-8B43-(E-Mail Removed)...
>>> If I want to hang javascript off of an aspropDownList control, how
>>> would I
>>> do this? There does not seem to be a "onchange" event so do I have to
>>> use
>>> an HTML control to do this?

>>

>
> If I remember well you have to put this code before Page_Load ...
> Page_Init is one accepted place.
>
> HTH
>
>
> --
> Gianluca Gravina
> http://blogs.ugidotnet.org/thinkingingrava



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I set the DropDownList.SelectedIndex of ONE DropDownList they ALL change! S_K Microsoft ASP .NET 5 14th Nov 2007 04:51 PM
DropDownList inside GridView: How to set SelectedIndex for the DropDownList? keithb Microsoft ASP .NET 0 1st May 2006 11:54 PM
GridView: Filter DropDownList for another DropDownList =?Utf-8?B?SnVhbmpv?= Microsoft ASP .NET 0 29th Dec 2005 07:44 AM
GridView: Filtr DropDownList from another DropDownList =?Utf-8?B?SnVhbmpv?= Microsoft ASP .NET 0 23rd Dec 2005 01:31 PM
DropDownList depending on DropDownList Jonathan Microsoft Dot NET 1 1st Nov 2004 03:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 AM.