asp:DropDownList
am 16.01.2008 20:19:00 von OldButStillLearning
If I want to hang javascript off of an asp:DropDownList 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?
Re: asp:DropDownList
am 16.01.2008 21:07:06 von Eliyahu Goldin
myDdl.Attributes["onchange"] = "myJavascriptFunction()";
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"OldButStillLearning" wrote
in message news:47FB6976-D408-475D-8B43-1F25214A50DB@microsoft.com...
> If I want to hang javascript off of an asp:DropDownList 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?
Re: asp:DropDownList
am 17.01.2008 08:09:56 von grava
"Eliyahu Goldin" wrote in
message news:epefjtHWIHA.4440@TK2MSFTNGP06.phx.gbl...
> myDdl.Attributes["onchange"] = "myJavascriptFunction()";
>
> --
> Eliyahu Goldin,
> Software Developer
> Microsoft MVP [ASP.NET]
> http://msmvps.com/blogs/egoldin
>
>
> "OldButStillLearning"
> wrote in message
> news:47FB6976-D408-475D-8B43-1F25214A50DB@microsoft.com...
>> If I want to hang javascript off of an asp:DropDownList 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
Re: asp:DropDownList
am 17.01.2008 09:33:27 von Eliyahu Goldin
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" wrote in message
news:2840ED34-3393-460C-BB1E-31AD7A8049ED@microsoft.com...
>
>
> "Eliyahu Goldin" wrote in
> message news:epefjtHWIHA.4440@TK2MSFTNGP06.phx.gbl...
>> myDdl.Attributes["onchange"] = "myJavascriptFunction()";
>>
>> --
>> Eliyahu Goldin,
>> Software Developer
>> Microsoft MVP [ASP.NET]
>> http://msmvps.com/blogs/egoldin
>>
>>
>> "OldButStillLearning"
>> wrote in message
>> news:47FB6976-D408-475D-8B43-1F25214A50DB@microsoft.com...
>>> If I want to hang javascript off of an asp:DropDownList 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