Saturday, March 24, 2012

Trigger stops working after first postback

Hi,

First let me explain the basic situation. I have a page with 2 list boxes (there are more, but for the sake of argument, take 2). The Box A contains a list of items. The Box B contains the list of items chosen by the user. There is an imagebutton that when clicked, moves the selected ListItem from Box A to Box B, and there is another imagebutton that moves a selected item from Box B to Box A.

Pretty straightforward. The list boxes are in separate update panels because they each have other triggers associated with them that are not common to the other. Here is what happens, when the move button is clicked the first time, the transfer works. After that, it's as if there is no postback at all.

Here is how I have it setup:

<

atlas:UpdatePanelID="LeftColPanel"runat="server"Mode="Conditional">
<ContentTemplate>
<asp:ListBoxID="LeftCol"runat="server"Rows="10"Width="140"/>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTriggerControlID="MoveToLeftCol"EventName="Click"/>
</Triggers>

<

asp:ImageButtonID="MoveToLeftCol"runat="server"ImageUrl="pics/left.gif"OnClick="MoveToLeft"/>

and similarly for the second List Box.

What I don't understand is why it works the first time, and not after that? Any help would be appreciated.

Thanks,

i also have the same problem with a gridview
i don't know the solution yet but do you have some strange character in your listbox?
like single quote, or something else

or maybe you already found the solution :)

if yes please let me know

thanks

No comments:

Post a Comment