Life is Unfair “La vie n’est pas juste” !

pMany of us use this expression when they experience an unfair phenomenon without being able to define the responsibility of this unfairness!

But how could we explain that someone who is powerful enough to take decisions that all concerned parties are obliged to accept without even negotiating , and he knows very well that his decision is unfair and when he is asked why he is taking this unfair decision , his answer is simple: “ Life is unfair” Continue reading “Life is Unfair “La vie n’est pas juste” !” ItemCommand asynchronous postback in an UpdatePanel

In Simply adding an UpdatePanel to a ListView with an ItemCommand won’t do the trick of asynchronous postback. The Command should be registered to the script manager Dynamically.

To achieve an asynchronous postback you have to do the following trick front end Code Example

<asp:UpdatePanel runat=”server” ID=”upContent”>
<asp:ListView runat=”server” ID=”lvContent”
onitemdatabound=”lvContent_ItemDataBound” >
<div class=”trd-block”>
<asp:LinkButton Text=”Delete” runat=”server” ID=”lnkDelete” CommandArgument='<%#Eval(“ID”) %>’  />

The solution comes in the Code Behind C# on the ItemDataBound

protected void lvContent_ItemDataBound(object sender, ListViewItemEventArgs e)
LinkButton delete = (LinkButton)e.Item.FindControl(“lnkDelete”);