dropdownlist in a datalist

A

Ashish Sharma

I have a drop down list inside a data list on a form like this :

<asp:DataList ID="DataList1" runat="server" EnableViewState="False">
<ItemTemplate>
<asp:Label ID="lblname" Runat="server" text='<%#
DataBinder.Eval(Container.DataItem,"Name") %>'> </asp:Label>
<asp:DropDownList id="DropDownList1" runat="server" DataTextField="Name"
DataValueField="UID" OnSelectedIndexChanged="CallMySub"
AutoPostBack="True"></asp:DropDownList>
</ItemTemplate>
</asp:DataList>

As you can see , the OnSelectedIndexChanged propoerty specifies a
procedure in code behind ..



I have two questions related to this

1. This event did not get fired till i made DataList's
EnableViewState="False". why is that

2. if i populate this datalist with three items, and then change the
selection on dropdownlist it fires the event once first time, then if i
change some other dropdownlist it fires correctly for that dropdownlist
, and then fires again for the previous one

to make it more clear if i have three dropdownlists on the form, and if
i change selection on different one each time it will get fired for all
the previous ones too, starting from latest one


again any help would be appreciated, iam trying to clear up things in my
mind over event firing sequences when controls are embedded in controls ...


TIA
-ashish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,095
Latest member
EmiliaAlfo

Latest Threads

Top