Darth_helge
asked on
call javascript from listbox event
Hi everyone!
I have this:
<asp:listbox id="ListBox0" runat="server" ></asp:listbox>
I want the onSelectedIndexChanged to call a javascript function called "doChange(text)"
(I can solve the problem with an AutoPostBack to the server, but then the whole page reloads, and this takes a while since i have big pictures and two <iframe> on it, and I don't want the page to reload)
How do I do this?
I have this:
<asp:listbox id="ListBox0" runat="server" ></asp:listbox>
I want the onSelectedIndexChanged to call a javascript function called "doChange(text)"
(I can solve the problem with an AutoPostBack to the server, but then the whole page reloads, and this takes a while since i have big pictures and two <iframe> on it, and I don't want the page to reload)
How do I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think tushar's answer is correct. User is talking about a client side alternative for SelectedIndexChanged, the client side event for this is "onChange" not "onClick"
ASKER
hello everyone.
im so sorry for not accepting any answers. it's just all the emails sent to me from this website was stopped by our new spam filter at work. i will see to it that your emails will slip through the filter hereafter
im so sorry for not accepting any answers. it's just all the emails sent to me from this website was stopped by our new spam filter at work. i will see to it that your emails will slip through the filter hereafter
you can say,
<asp:listbox id="ListBox0" runat="server" onChange="dochange(text)";
or
ListBox0.Attributes.Add("O
when you are adding onChange event in the aspx page, you wouldnt find that in the intellisense, since its only client side event, server controls only show the events which can be handled in the server side only. So, since onChange is not handled on the server, vs.net wouldnt bother to show it in the intellisense, since at that moment, the control is only a server control, not a html control
Thought I would add something extra to what the previous guys said