Fedor
I created a sample that does not use the GridView for clarity but does duplicate the issue. If you uncomment the UpdatePanel’s Triggers, the page will postback and show the image in the ModalPopup. Then comment out the PostBackTrigger and the image will not load.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Modal.aspx.cs" Inherits="ModalPopupExtenderTest.Modal" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxControlToolkit" %>
<%@ Register Assembly="Aurigma.GraphicsMill.AjaxControls" Namespace="Aurigma.GraphicsMill.AjaxControls" TagPrefix="aurigma" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>ModalPopupExtender Test</title>
<style type="text/css">
.modalBackground {
background-color:Gray;
filter:alpha(opacity=70);
opacity:0.7;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<%--!!! Uncomment Triggers to show image !!!--%>
<%--<Triggers>
<asp:PostBackTrigger ControlID="ButtonShowImage" />
</Triggers>--%>
<ContentTemplate>
<asp:Button ID="ButtonShowImage" runat="server" Text="Show Image" onclick="ButtonShowImage_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Button ID="ButtonNone" runat="server" Style="display: none" />
<ajaxControlToolkit:ModalPopupExtender ID="ModalPopupExtenderImage" runat="server" TargetControlID="ButtonNone"
PopupControlID="PanelImage" DropShadow="false" CancelControlID="ButtonClose" BackgroundCssClass="modalBackground">
</ajaxControlToolkit:ModalPopupExtender>
<asp:Panel ID="PanelImage" runat="server">
<div align="right">
<asp:Button ID="ButtonClose" runat="server" Text="Close" OnClick="ButtonClose_Click" />
</div>
<aurigma:BitmapViewer ID="BitmapViewerImage" runat="server" ScrollBarsStyle="Auto" ZoomQuality="Low"
Height="500px" Width="500px" BorderWidth="5px" ViewportAlignment="CenterCenter"
BorderStyle="Solid" BorderColor="Blue">
</aurigma:BitmapViewer>
</asp:Panel>
</div>
</form>
</body>
</html>
using System;
namespace ModalPopupExtenderTest
{
public partial class Modal : System.Web.UI.Page
{
const string testImage = "C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Winter.jpg";
protected void Page_Load(object sender, EventArgs e)
{
PanelImage.Attributes.Add("style", "display:none");
}
protected void ButtonShowImage_Click(object sender, EventArgs e)
{
PanelImage.Attributes.Remove("style");
BitmapViewerImage.Bitmap.Load(testImage);
ModalPopupExtenderImage.Show();
}
protected void ButtonClose_Click(object sender, EventArgs e)
{
ModalPopupExtenderImage.Hide();
}
}
}
Thanks
Trey