Re: cannot fire up dropdownlist's SelectedIndexChanged
From: avnrao (avn_at_newsgroups.com)
Date: 06/09/04
- Next message: ranganh: "RE: least number of Deployment files"
- Previous message: angus: "how to generate barcode label in asp.net"
- Maybe in reply to: Daniel: "cannot fire up dropdownlist's SelectedIndexChanged"
- Next in thread: Steven Cheng[MSFT]: "Re: cannot fire up dropdownlist's SelectedIndexChanged"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 9 Jun 2004 10:18:31 +0530
you said you are adding it as an attribute..
if you are doing this..
DropDownList1.Attributes.Add("onchange","alert(2);return;");
make sure that you should not have the return status after your javascript
executes. remove the RETURN from above line.
asp.net spits out the html like this..
<select name="DropDownList1"
onchange="alert(2);return;__doPostBack('DropDownList1','')"..
so having return on onchange would not fire post back.
Av.
"martin" <Stuart_REMOVE_36@yahoo.com> wrote in message
news:enxvwlbTEHA.1988@TK2MSFTNGP12.phx.gbl...
> try returning "true" from the dropdown list
>
> <select ddl... onchange="myevent();return true;"
>
> I noticed that I had to use this method on a checkbox that poste back.
>
> make sure that true is returne before the call to the .net generated
> javascript.
>
> HTH
>
> cheers
>
> martin
>
>
>
> "Daniel" <someone@yahoo.com> wrote in message
> news:OK6IGQbTEHA.2972@TK2MSFTNGP12.phx.gbl...
>> Yes, i've done that, but still cannot fire up, there is a javascript
>> onChange on this dropdownlist, i wonder it will affect this.
>>
>> Thanks.
>>
>>
>>
>> "Shaun C McDonnell" <mshaun@bellsouth.net-spammers-stop.now> wrote in
>> message news:%23nlWJgaTEHA.2128@TK2MSFTNGP09.phx.gbl...
>> > Set the AutoPostBack property to "true" on the DropDownList.
>> >
>> > Shaun
>> >
>> >
>> > "Daniel" <someone@yahoo.com> wrote in message
>> > news:%23Rf1ASaTEHA.204@TK2MSFTNGP10.phx.gbl...
>> > > Is there any other way can override this event, like javascript
> onchange
>> > > added to the attribute of this dropdownlist?
>> > >
>> > > Thanks
>> > >
>> > >
>> >
>> >
>>
>>
>
>
- Next message: ranganh: "RE: least number of Deployment files"
- Previous message: angus: "how to generate barcode label in asp.net"
- Maybe in reply to: Daniel: "cannot fire up dropdownlist's SelectedIndexChanged"
- Next in thread: Steven Cheng[MSFT]: "Re: cannot fire up dropdownlist's SelectedIndexChanged"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|