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
<%
<
.igdw_Control
{
}
.ig_Control
.igdw_HeaderArea
.igdw_HeaderCornerLeft
.igdw_HeaderContent
.igdw_HeaderButtonArea
.igdw_HeaderCornerRight
.igdw_BodyEdgeLeft
.igdw_BodyContentArea
.igdw_BodyContent
.igdw_BodyEdgeRight
.igdw_BodyCornerBottomLeft
.igdw_BodyEdgeBottom
.igdw_BodyCornerBottomRight
</
1.
2.
3.
4.
5.
6.
7.
8.
-----------------------------Code Behind -------------------------------------
using
So, I'm certain the behavior I am detailing, which kprestage0 reported, is a valid bug. Here is a workaround. Use the OnClientClick and OnClick attributes for the "Cancel" and "OK" asp:Button that you want to cause the dialog to close. For example, you may have 2 buttons in the WebDialogWindow Template like this:<asp:Button ID="_btnDialogOK" runat="server" Text="OK" OnClientClick="closeDialog();" OnClick="_btnDialogOK_Click" /><asp:Button ID="_btnDialogCancel" runat="server" Text="Cancel" OnClientClick="closeDialog();" />You would also need to give the JavaScript a handle to the WebDialopgWindow object. That can be done with the Initialize ClientEvent:<ClientEvents Initialize="_wdwOpenImport_Initialize" />The JavaScript would look like:<script language="javascript" type="text/javascript">var webDialogWindow;function _wdwOpenImport_Initialize(dialog){ webDialogWindow = dialog;}function closeDialog(){ webDialogWindow.hide(); return true;}</script>When the dialog initializes, _wdwOpenImport_Initialize is called, which stores a reference to the dialog in a JavaScript object.When the "Cancel" button is clicked, the JavaScript function specified in "OnClientClick" is called, which hides the dialog.When the "OK" button is clicked, the JavaScript function specified in "OnClientClick" is called, which hides the dialog; then, if that function returns true, the server-side event handler specified in "OnClick" will be called so that you can do whatever you need to on the server side.Of course, this is a workaround, and as such may not work for all scenarios. It would be much nicer to just be able to use: WebDialogWindow1.WindowState = DialogWindowState.Hidden;on the serve-side and be done with it...
Hello,
The whole problem is that playing with the "Visible" property of any control while inside UpdatePanel does have its side effects. Setting visible to false for any control completely removes it from the control tree and it is not rendered at all on any page, so complex controls like WebDiaogWindow for example amy incur side-effects because of that. I started from your code and instead of using the Visible property, I used the WindowState property of the control and got much better results. Just make sure you remove the Visible = False hardcoded property in your ASPX declaration first, and then show/hide the dialog window with:
protected void Page_Load(object sender, EventArgs e)
WebDialogWindow1.WindowState = DialogWindowState.Hidden;
protected void Button1_Click(object sender, EventArgs e)
WebDialogWindow1.WindowState = DialogWindowState.Normal;
protected void Button2_Click(object sender, EventArgs e)
In any case, you can also submit your scenario as a bug through our official Bug Report system located here: http://devcenter.infragistics.com/Protected/SubmitSupportIssue.aspx Hope this helps.