|
Hi,
I use to open the modal dialog in Button_Click event.
Dim objSelected As New Microsoft.Web.UI.WebControls.TreeNode
objSelected = objTree.GetNodeFromIndex(objTree.SelectedNodeIndex)
Dim NodeType As Integer = GetItemType(objSelected.NodeData)
Select Case (NodeType)
Case ITEM_TYPE.FILE
'open the EditFile.aspx
LJscript.Text = "<script language='javascript'>"
LJscript.Text += "window.showModalDialog('EditFile.aspx', window, 'dialogHeight:600px;dialogWidth:600px;center:Yes;help:No;resizable:No;status:No;toolbar:No;menubar:No;dialogLeft:300;dialogTop:300');"
LJscript.Text += "</script>"
Response.Write(LJscript.Text)
Case Else
'open Edit.aspx
'open the EditFile.aspx
LJscript.Text = "<script>"
LJscript.Text += "window.showModalDialog('Edit.aspx', window, 'dialogHeight:400px;dialogWidth:400px;center:Yes;help:No;resizable:No;status:No;toolbar:No;menubar:No;dialogLeft:300;dialogTop:300');"
LJscript.Text += "</script>"
Response.Write(LJscript.Text)
End Select
Before popping up the window, I checked some conditions. Based on the result , I opened the pop-up window. ( eg: if result is A, then pop-up window A, if result is B then pop-up window B)
The problem is the windows gets popped up but when I move that dialog window, then the screens leaves with the shades as I move the dialog window on the screen.
If don't use Response.Write() method to executed javascript, then it's workig fine.
Register the script block and then add 'onclick' attributes and call the javascript is working fine.
But I need to check some condidtion before popping up the window.
Are there any work arounds for this?
Thanks. |