MiBlg
asked on
ASP.NET Clientside Linked Dropdown Listbox
Hi,
Could someone teach me how to implement a linked Dropdown listbox. What I mean here is that a value for one listbox will determine the list of another listbox, but It doesn't do any postback to the server, ie it's performed on clientside.
For example, there is two dropdown list box. One is a Product Category Listbox, another is a Product Listbox. If user select a value in the Product Category Listbox, say it's A, then Product listbox will show all products belongs to A category. However, the action doesn't generate any roundtrip to the server. It's performed on clientside.
How to achieve that in ASP.NET?
Thanks for any help
MI
Could someone teach me how to implement a linked Dropdown listbox. What I mean here is that a value for one listbox will determine the list of another listbox, but It doesn't do any postback to the server, ie it's performed on clientside.
For example, there is two dropdown list box. One is a Product Category Listbox, another is a Product Listbox. If user select a value in the Product Category Listbox, say it's A, then Product listbox will show all products belongs to A category. However, the action doesn't generate any roundtrip to the server. It's performed on clientside.
How to achieve that in ASP.NET?
Thanks for any help
MI
ASKER
Yes, I need some sort of javascript on the clientside but how to create such a script and output it from the C#
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you have to pass your script to the HttpContext.Current.Respon se object
so except i wanna pass a little javascript which opens a messagebox i would have todo the following:
HttpContext.Current.Respon se.Write(" <script type=\"text/javascript\">\ n<!--\nale rt(\"testp opup\");\n //-->\n</s cript>\n") ;
remember that the html code has to have control chars for newline etc like \n.
but if you write \n to a string first, it will be interpreted as newline and will not be \n.
so you would have to use the @ before your string.
hope this will help
vo1d
so except i wanna pass a little javascript which opens a messagebox i would have todo the following:
HttpContext.Current.Respon
remember that the html code has to have control chars for newline etc like \n.
but if you write \n to a string first, it will be interpreted as newline and will not be \n.
so you would have to use the @ before your string.
hope this will help
vo1d
ASKER
vo1d thanks for your suggestion, but I found landerd's comment is really useful.
ASKER
landerd, that site gives me what I'm looking for and even more!
Thanks a million
MI
Thanks a million
MI
you will need to make a javascript which will change the listbox data, cause javascript is execute on the client.
c# code is executed on the serversite.
mfg
vo1d