J
Jeff User
HI all.
I am using .NET1.1 , C#.
For the most part I am using server side C# code for many pages and
have been coming along OK. But now, I would like to populate a listbox
on the client side (if possible) based on the user selection of an
item in a dropDownList .
I found this example and tryed it but the value added to the listBox
does not display. However, if I then postback for any other reason at
all (including click a button with no function attached to it) then
the new value added to the list appears.
aspx page <head> section:
<script language="C#" runat="server">
void oIndexChanged (Object sender, EventArgs e)
{
lbPrivileges.Items.Add("New_Item");
}
</script>
<asp:dropdownlist id="ddlDbObjects" style="Z-INDEX: blah blah blah
runat="server" OnSelectedIndexChanged="oIndexChanged">
autopostback for dropDownList is set to false.
1) Does this script run on the client side but result does not appear
or doesn't it even run?
2) This example code showed using C# language scipt. Would java script
be better and of so, what are the reasons for using one over the other
- C# code or java script - on client side.
3) What do I need to do accomplish my goal? Fix the above or something
entirely different?
Thanks
Jeff
I am using .NET1.1 , C#.
For the most part I am using server side C# code for many pages and
have been coming along OK. But now, I would like to populate a listbox
on the client side (if possible) based on the user selection of an
item in a dropDownList .
I found this example and tryed it but the value added to the listBox
does not display. However, if I then postback for any other reason at
all (including click a button with no function attached to it) then
the new value added to the list appears.
aspx page <head> section:
<script language="C#" runat="server">
void oIndexChanged (Object sender, EventArgs e)
{
lbPrivileges.Items.Add("New_Item");
}
</script>
<asp:dropdownlist id="ddlDbObjects" style="Z-INDEX: blah blah blah
runat="server" OnSelectedIndexChanged="oIndexChanged">
autopostback for dropDownList is set to false.
1) Does this script run on the client side but result does not appear
or doesn't it even run?
2) This example code showed using C# language scipt. Would java script
be better and of so, what are the reasons for using one over the other
- C# code or java script - on client side.
3) What do I need to do accomplish my goal? Fix the above or something
entirely different?
Thanks
Jeff