Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Works great ONCE. Not if you need to reopen though.
posted

This problem has been in existance ever since this control was added to the library.  I was hoping that in the 3.5 version it would finally be fixed, but it is not.  If you use the Modal Dialog with an update panel, it never works as expected.  You can get it to open once from the code behind by setting the panel to visible, but if you use the x button on the title bar and then reopen, nothing happens, if you write your own button to close it from the code behind, you can hide it, but when it reshows, it is no longer modal.  These bugs make this control pretty much useless, so I wonder why they have not been fixed yet.  Here is a quick sample.

 aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="Infragistics35.Web.v8.2, Version=8.2.20082.1000, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.LayoutControls" tagprefix="cc1" %>

<!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>Untitled Page</title>

<style type="text/css">

 

 

.igdw_Control

{

background-color:Transparent;border-width:0px;

}

 

.ig_Control

{

background-color:White;

font-size:xx-small;

font-family: verdana;

border:solid 1px #ABC1DE;

cursor:default;color:Black;

}

 

.igdw_HeaderArea

{

background-color:Transparent;

font-weight:bold;

border-width:0px;

height: 24px;

cursor:default;color:White;

}

 

.igdw_HeaderCornerLeft

{

background-color:Transparent;

background-position:top left ;

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_headercornerleft.gif);width: 9px;

}

 

.igdw_HeaderContent

{

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_headercontent.gif);

}

 

.igdw_HeaderButtonArea

{

width: 120px;vertical-align:middle;

}

 

.igdw_HeaderCornerRight

{

background-position:top right ;

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_headercornerright.gif);

width: 9px;

}

 

.igdw_BodyEdgeLeft

{

background-color:WhiteSmoke;

background-repeat:repeat-y;

border-right:solid 1px #BBBBBB;

border-left:solid 1px #666666;

width: 6px;

}

 

.igdw_BodyContentArea

{

background-color:White;vertical-align:top;

}

 

.igdw_BodyContent

{

border:solid 0px #999999;

}

 

.igdw_BodyEdgeRight

{

background-color:WhiteSmoke;

border-right:solid 1px #666666;

border-left:solid 1px #BBBBBB;width: 6px;

}

 

.igdw_BodyCornerBottomLeft

{

background-color:WhiteSmoke;

background-repeat:no-repeat;

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_bodycornerbottomleft.gif);

font-size:1px;

height: 14px;width: 9px;

}

 

.igdw_BodyEdgeBottom

{

background-color:WhiteSmoke;

background-repeat:repeat-x;

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_bodyedgebottom.gif);

font-size:1px;

border-top:solid 1px #BBBBBB;height: 14px;

}

 

.igdw_BodyCornerBottomRight

{

background-color:Gainsboro;

background-repeat:no-repeat;

background-image: url(C:/ModalExample/ig_res/Default/images/igdw_bodycornerbottomright.gif);

font-size:1px;

height: 14px;width: 9px;

}

 

</style>

</head>

<body>

<form id="form1" runat="server">

<p>

This is a test page of the modal dialog box.<asp:ScriptManager

ID="ScriptManager1" runat="server">

</asp:ScriptManager>

</p>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:Button ID="Button1" runat="server"

onclick="Button1_Click" Text="Button" />

<cc1:WebDialogWindow ID="WebDialogWindow1" runat="server" Height="300px"

Modal="True" Visible="False" Width="400px">

<ContentPane>

<Template>

hey look, its a modal dialog.&nbsp; SOMETIMES!!!

<asp:Button ID="Button2" runat="server" onclick="Button2_Click"

Text="CLOSE DIALOG NOW" />

</Template>

</ContentPane>

</cc1:WebDialogWindow>

</ContentTemplate>

</asp:UpdatePanel>

<p>

1.&nbsp; Click the button above to open a modal dialog</p>

<p>

2.&nbsp; See modal dialog work</p>

<p>

3.&nbsp; Click the (x) Button to close dialog</p>

<p>

4.&nbsp; Open dialog again, it does not show up at all!!</p>

<p>

5.&nbsp; Refresh the page and open the dialog.&nbsp; It works!</p>

<p>

6.&nbsp; Click the &quot;CLOSE DIALOG NOW&quot; Button, it closes</p>

<p>

7.&nbsp; Open the dialog again</p>

<p>

8.&nbsp; It shows, but it is NOT modal!!!</p>

<p>

&nbsp;</p>

<div>

 

</div>

</form>

</body>

</html>

-----------------------------Code Behind -------------------------------------

using System;

using System.Configuration;

using System.Data;

using System.Linq;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

}

protected void Button1_Click(object sender, EventArgs e)

{

WebDialogWindow1.Visible =
true;

}

protected void Button2_Click(object sender, EventArgs e)

{

WebDialogWindow1.Visible =
false;

}

}