Redirecting to another page from JavaScript.showModalDialog window

Hope you all had a wonderful christmas celebration,so this is my first post after christmas where I had a good two weekend days.

Redirecting to another page from JavaScript Modal window without closing the window will not work if use the following client side code ,it always opens a new modeless window where the page will be displayed.

Window.location = url
document.location = url
top.location.href= url

so what we do and how we get a page redirected within the same window instance ,okay here we go.

Consider you have a page called Main.aspx where you have hyper link or a button which you want open a page called ‘OpenmeinModal.aspx” where from inside the ‘OpenmeinModal.aspx” you want to redirect to a new page called ‘redirectmewithinsamewindow.aspx”. You achieve this using the below sample code all you need to do is create a frameset.

Enjoy

Advertisements

One thought on “Redirecting to another page from JavaScript.showModalDialog window

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s