In my form I have a listview and a panel which is used as popup window inside a updatepanel.
I am dynamically creating popup window using modalpopupextender on listview ltemcommand.
here is my code to open the popup
protected void LstCreativeBin_ItemCommand(object sender, ListViewCommandEventArgs e)
{
switch (e.CommandName)
{
case "UploadFile":
ListViewDataItem currentItem = (ListViewDataItem)e.Item;
DataKey currentDataKey = LstCreativeBin.DataKeys[currentItem.DisplayIndex];
int contestid = Convert.ToInt32(currentDataKey["participantSlno"]);
IframeEdit.Attributes.Add("src", "Uploadfile.aspx?id=" + Convert.ToString(contestid));
ModalPopupExtender1.Show();
break;
}
}
My problem is the page is refreshing even if it’s inside the updatepanel. I have added the LstCreativeBin_ItemCommand to asynchronous trigger in update.
What is need here is :
- Opening the pop up asynchronously.
- Refreshing the update panel on popup close.
how about opening the modalpopupextender without going to code-behind … if you open it with dynamic controls, you can point the modalpopupextender to TargetControlID a dummy like a hidden control, and you can add to each listview item a onclick to hidden_control.click() or just $find(modal).show()