views:

297

answers:

2

I'm opening a modal dialog for IE6 and above using the following javascript.

window.showModalDialog(
             'SelectUser.aspx',
              null,
              'status:no;dialogWidth:500px;dialogHeight:220px;dialogHide:true;help:no;
              scroll:yes;toolbar:no;title:no;resizable:yes;location:no;menubar:no;'
            );

In the popup dialog box a grid is shown from which user can select... Grid has paging applied to it however when the pager link for next, previous, first, last or any page number is clicked page index changed is fired and page is posted back and the page result is shown in a new IE window. How to fix this.

A: 

Show your page (SelectUser.aspx) in iframe in the popup window.

Alex Reitbort
A: 

The modal dialog box if contains a form and when post back will open up in a new window. However there is a workaround to this and that is to Add <base target="_self"/> inside of the <head> tags in the .aspx file of the ModalDialog window.

S M Kamran
You can also specify target attribute in the form tag of the ModalDialog.aspx file.<form Method='....' target='yourmodaldialogscript.aspx"> .... ....</form>
S M Kamran