Modal Web Form Dialogs ???

asp.net United States
  • 18 years ago

    I'm working on an application that makes use of MSIE 4.0 + "showModalDialog" JavaScript/JScript function.  The calling page does something like this:


    showModalDialog('MyDialog.aspx' + queryString, dialogArgs, displaySettings);


    As one can see, the resource called by the dialog window is an ASP.NET web form.  The problem is that MSIE dialog windows do not work well with ASPX post-backs.  Upon any user event that should cause a post-back, the dialog window launches a new window that causes an error.


    For example, using the default previous/next controls of the DataGrid control (named "dgSelection"), clicking either previous or next link will launch a new window with the following address:


    javascript:_doPostBack('dgSelection:ctl14:_ctl1','')


    The function "__doPostBack" is generated by ASP.NET.  This naturally causes an error because the function exists in the dialog window and should be called there and not in a new window.


    There seems to be no documentation about using these kind of dialog boxes with ASP.NET web forms.  I did try to set the <FORM target="_self"> attribute, but that had no effect.


    Does anyone have any idea how to get a dialog window to respond correctly to post-backs?  There is always the option of re-coding to use window.open() rather than showModalDialog(), but I would rather not re-invent the wheel, especially at the cost of development time and some functionality.


    Thanks in advance.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Brevity is the soul of wit” - Shakespeare