Sorry, but i do not understand what you mean.
So i have an UpdatePanel set to Conditional.
Inside it, i have a Repeater which contains that Image Button
I put:
<asp:ImageButton ID="imgBtnWishList" runat="server"
OnClick="addProductToWishList"
ImageUrl="../Site/images/featured-wishlist.jpg"
/>
<asp:ImageButton ID="imgBtnWishList" runat="server"
OnClick="addProductToWishList"
ImageUrl="../Site/images/featured-wishlist.jpg"
/>
When the page is loading i register this ImageButton for the UpdatePanel as trigger:
Repeater repeaterDetalii = (Repeater)Tab1.FindControl("repeaterDetalii");
foreach (RepeaterItem rptItem in repeaterDetalii.Items)
{
ImageButton imgBtnWishList = (ImageButton)rptItem.FindControl("imgBtnWishList");
AsyncPostBackTrigger triggerWishList = new AsyncPostBackTrigger();
//triggerWishList.EventName = "Click";
triggerWishList.ControlID = imgBtnWishList.UniqueID.ToString();
UpdatePanelSortTop.Triggers.Add(triggerWishList);
_scriptMan.RegisterAsyncPostBackControl(imgBtnWishList);
}
And when the image button is clicked is should fire this method:
public void addProductToWishList(object sender, EventArgs e)
{
ImageButton imgButton = (ImageButton)(sender);
RepeaterItem rptParentItem = (RepeaterItem)imgButton.Parent;
ImageButton imgBtnWishList = (ImageButton)sender;
RepeaterItem repetear = (RepeaterItem)imgBtnWishList.Parent;
if (MySession.Current.userId != 0)
{
int userId = MySession.Current.userId;
wishQ.insertInWishList(userId, utils.getCategoryAliasById(category), getProductId(rptParentItem.ItemIndex));
}
else
//
{
ModalPopupExtender loginPopUp = (ModalPopupExtender)Page.FindControl("loginPopUp");
loginPopUp.Show();
}
}
That's all. If i put the ImageButton outside the UpdatePanel and comment the lines that triggers it,
it causes a postback and the method is fired.
But within the UpdatePanel, as i showed above the method is not FIRED :((
.
Anyone knows WHY???