showModalDialog and postbacks in ASP.NET

I learned something new today that my coworker Dennis spent several agonizing hours trying to solve.  He was using window.showModalDialog to open a modal window on the client from Javascript, but whenever that page posted back, it would spawn off a new window.  (A normal window.open worked fine, this was only a problem for modal windows).  Some searching turned up several people with the same problem, and the solution once found (here), was quite simple:  just include this line in the < HEAD > html of the modal window:

<base target=_self>

Hope this saves someone else some time!
Marcie

Published Thursday, August 11, 2005 3:01 PM by datagridgirl

Comments

# re: showModalDialog and postbacks in ASP.NET

It's not work under IE 5.0

Thursday, August 11, 2005 9:07 PM by bestcomy

# re: showModalDialog and postbacks in ASP.NET

Interesting, it works great for us under IE 6, and both <base> and showModalDialog were around in IE 5, so I'm surprised that it doesn't work there.

Thursday, August 11, 2005 9:13 PM by Marcie

# re: showModalDialog and postbacks in ASP.NET

The standard solution I always employed was to load a dummy page in the modal dialog that only writes out an IFRAME to the window (height/width 100% and no border). The IFRAME is given a SRC tag of the actual page to be viewed. In this case, postbacks and whatnot will work fine in a showModalDialog or showModelessDialog.

Thursday, August 11, 2005 11:42 PM by Ron Buckton

# re: showModalDialog and postbacks in ASP.NET

I've run into this problem too and did the following:
* when entering the page i give window.name a unique name.
* i set the target of my links to this name

btw:
window.navigate(newUrl) or
window.location.href = newUrl will open a new window.
use window.open(newUrl, window.name) instead.

and:
disable all caching for pages that are used in modal dialogs. When IE has to show a url that's cached it loads from the cache without asking the server in some circumstances.

better than ron's approach but I can't check whether it works fine with IE 5.x
(got an upgrade some years ago)

Saturday, August 13, 2005 8:22 AM by MatHertel

# re: showModalDialog and postbacks in ASP.NET

Thank you so much MatHertel the window.name works great!!!

Btw, <base target=_self> didn't work for me :S

Thursday, August 25, 2005 1:07 PM by Shake

# re: showModalDialog and postbacks in ASP.NET

It solve my problem when i was working on progress bar with VB.net.

Thank a lot.

Wednesday, July 04, 2007 5:32 PM by Elen

# re: showModalDialog and postbacks in ASP.NET

I want to write the AJAX response in the Modal Window. Has any one got the  solution for this?

Thanks In advance

Friday, July 13, 2007 5:12 AM by Anand

# re: showModalDialog and postbacks in ASP.NET

Thanks Marcie for this solution.

<base target="_self" />

My team must have spent some 30 man hours on this problem.

btw, I saw some comments that this solution didn't work for them... Make sure they are using window.showModalDialog and not window.open.

Thursday, August 09, 2007 4:16 PM by Neeraj

# re: showModalDialog and postbacks in ASP.NET

Exact solution

thanks

Thursday, August 16, 2007 3:07 AM by Pradeep Bisht

# re: showModalDialog and postbacks in ASP.NET

Thanks Marcie,

I spent 6 hours on this problem

and <base target="_self" />  resolve my problem

Friday, August 17, 2007 6:46 AM by Pavel

# re: showModalDialog and postbacks in ASP.NET

Perfect.  Similar story to others: wasted a few hours on this, until I saw your solution.  Thanks.

Monday, August 20, 2007 12:42 PM by Dan O'Connell

# re: showModalDialog and postbacks in ASP.NET

Unbelievable, never thought that would be the resolution, again, more than a few hours wasted and thinking there was no solution. Cheers!

Friday, September 07, 2007 6:27 AM by Brent Campbell

# re: showModalDialog and postbacks in ASP.NET

Wasted 5 minutes.  Did a google search.  Found this great article.  Very happy that I did not waste 30 man hours.  Thanks everyone.

Friday, September 07, 2007 6:20 PM by Ali

# re: showModalDialog and postbacks in ASP.NET

Worked great... Thanks...

Wednesday, September 12, 2007 4:51 PM by Mahesh Nihalani

# re: showModalDialog and postbacks in ASP.NET

Base target solution worked fine for me after trying other things for hours. Thanks for your effort to find and post this solution.

Wednesday, September 26, 2007 7:06 AM by Karu Anna

# re: showModalDialog and postbacks in ASP.NET

thanks .. saved my day.

Thursday, September 27, 2007 5:33 PM by Suresh

# re: showModalDialog and postbacks in ASP.NET

Worked like a charm !

:-)

Friday, September 28, 2007 3:25 AM by Indika

# re: showModalDialog and postbacks in ASP.NET

Thanks for posting this - it works

Monday, October 01, 2007 11:42 AM by Kenny

# re: showModalDialog and postbacks in ASP.NET

Works for me!!!

Uhul!!!

Thanks Marcie!

Wednesday, October 03, 2007 11:07 AM by Alberto

# re: showModalDialog and postbacks in ASP.NET

Great solution,

really u saved my time. I was breaking my head since 2 days..

once again thanks,

hari

Tuesday, October 09, 2007 3:24 AM by Hariprasad

# re: showModalDialog and postbacks in ASP.NET

Works fine...  Good article...  Thanks a lot...

Tuesday, October 16, 2007 2:12 AM by DotNetter

# re: showModalDialog and postbacks in ASP.NET

Working Fine

thnx

Wednesday, November 14, 2007 11:10 AM by Anand

# re: showModalDialog and postbacks in ASP.NET

Why it is not solving my issue.. I have grid in modal popup.. When i click Edit button it is getting postback. All code gets executed but on poup page it is not coming in edit mode.. I have edit item template defined... and it is not visible on screen on click of edit button..

What to do ....????

Monday, November 19, 2007 9:25 AM by Naman

# re: showModalDialog and postbacks in ASP.NET

Fantastic,

I was about to move to window.open.

saved my day

Thanks

Wednesday, November 28, 2007 3:12 AM by veeru

# re: showModalDialog and postbacks in ASP.NET

<base target=_self>

Works fine..

but the title of IE goes away.. when is posted...

is there any solution ? that will not make any change in the iE title

Monday, December 03, 2007 4:58 AM by LAKSMANAN

# re: showModalDialog and postbacks in ASP.NET

Another happy customer! <BASE Target=_self> works fine for me.

Thanks for saving me a lot of time.

Monday, January 07, 2008 5:54 AM by Dave Johnson

# re: showModalDialog and postbacks in ASP.NET

thanks a lot , it is working fine. I spent three hours and breaking my head

Friday, January 11, 2008 4:57 AM by Amit

# re: showModalDialog and postbacks in ASP.NET

It's not working for me.

I'm using master pages.

Wednesday, January 23, 2008 4:47 AM by Neelima

# re: showModalDialog and postbacks in ASP.NET

It's not working for me.

I'm using master pages.

function VendorContact(VendorId)

   {

     Options = "dialogTop:50px; dialogLeft:50px;dialogWidth:340px;dialogHeight:155px;help:no;scroll:no;status:no"

     OpenReportJS = window.showModalDialog("VendorContact.aspx?VID=" + VendorId,"_blank",Options) ;

   }  

And i'm getting the vendorid from xsl.

I got an error like "Object doesn't support this action".

I have been trying htis from past 5 hours.

Please help me out in giving the solution.

Wednesday, January 23, 2008 5:30 AM by Neelima

# re: showModalDialog and postbacks in ASP.NET

thanks a lot , it is working fine. I spent three hours and breaking my head

Tuesday, February 05, 2008 5:25 AM by Roberto

# Modal Dialog and PostBack

The answer on how to do postback in modal / modaless diaglogs. weblogs.asp.net/.../archive

Wednesday, February 06, 2008 12:24 AM by Frederick Chapleau weBlog on IT.

# re: showModalDialog and postbacks in ASP.NET

You've saved my life!

Thanks

Thursday, February 07, 2008 2:36 AM by SAV

# re: showModalDialog and postbacks in ASP.NET

Very good solution - i have been fighting with this several times - great - thanks :)

Thursday, February 07, 2008 6:26 AM by Stronghold

# re: showModalDialog and postbacks in ASP.NET

<base target="_self" />

worked great

Many thanks

Friday, February 15, 2008 5:03 PM by Len

# re: showModalDialog and postbacks in ASP.NET

Love you marcie.

You save my day.

Saturday, February 23, 2008 2:07 PM by Panya

# re: showModalDialog and postbacks in ASP.NET

Really worked..Thanks :)

Monday, February 25, 2008 1:58 AM by Renz

# re: showModalDialog and postbacks in ASP.NET

Lots of thanks!!!

Be careful, because it doesn't runs if smartnavigation is true.

Sorry for my english.... :(

Sunday, March 09, 2008 5:08 PM by Beatriz

# re: showModalDialog and postbacks in ASP.NET

When I use <base target="_self" /> I can't use the Virtual Earth Mapping control under IE 6

Monday, March 24, 2008 3:14 PM by Dan

# re: showModalDialog and postbacks in ASP.NET

Thank you Marcie, you save my life.

Now I have a problem when I'm trying to access opener's controls from the child modal window but this problem doesn't appear when the child window was open by using "window.open" instead "window.showModalDialog".

Do anybody know how to solve this issue?

Thanks in advance.

Wednesday, March 26, 2008 10:31 AM by Irwin Y. Quintana Fitta

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot Marcie!

Good solution for this issue.

Thanks a lot again.

For those who need information about  "showModalDialog" check the following link

msconline.maconstate.edu/.../jsdhtml07-05.htm

Friday, March 28, 2008 5:16 AM by Sathish

# re: showModalDialog and postbacks in ASP.NET

What an easy solution, I was running out of ideas!  Thank you.

Tuesday, April 08, 2008 4:30 PM by Ryan

# re: showModalDialog and postbacks in ASP.NET

It worked for me. Great solution. I was breaking my head on this for last two days. Thank You.

Thursday, April 24, 2008 4:27 PM by SP

# re: showModalDialog and postbacks in ASP.NET

Thank you very much.

Monday, May 12, 2008 10:06 PM by T

# re: showModalDialog and postbacks in ASP.NET

thanx u alot , it was great

Wednesday, May 21, 2008 7:24 AM by mahdokht

# re: showModalDialog and postbacks in ASP.NET

yes <base target="_self" > works for submitting a request through a modal window without opening a new window.

But make sure you DO NOT HAVE any other property set like document.forms[0].target  = _self (I was doing it and it was not working)

Another thing i noticed is title disappears after the modal window refreshes !! someone mentioned it in the post but no one answered it ?? can anyone provide some inputs on it ??

Wednesday, May 21, 2008 4:19 PM by eminently_addictive

# re: showModalDialog and postbacks in ASP.NET

To make sure the title does not disappear after a request is made from a modal window ... all you have to do is make sure the title is the first tag after ur head tag ..

<head>

<title>

ur title

</title>

<base target=_self>

.

.

</head>

Hope this helps anyone ... and thanks to all who posted their comments.

Wednesday, May 21, 2008 4:32 PM by eminently_addictive

# re: showModalDialog and postbacks in ASP.NET

Hey thanks....

no matter what they said about your solution, it is the simplest and for me it's the best.

Friday, June 06, 2008 11:51 AM by Deo

# re: showModalDialog and postbacks in ASP.NET

it worked for me. Great solution. I spent several hours and nothing. Thank you so much.

Monday, June 16, 2008 6:14 PM by Joseph John

# re: showModalDialog and postbacks in ASP.NET

Thanks buddy..it worked for me

I was using .net 3.5 , C# asp.net

Wednesday, June 25, 2008 6:41 AM by Norman

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot...

it was of a gr8 help 2 me...

Wednesday, July 23, 2008 9:49 AM by Harsh

# re: showModalDialog and postbacks in ASP.NET

Thanks,

i help me lot

Thursday, August 07, 2008 8:55 AM by Jolly

# re: showModalDialog and postbacks in ASP.NET

Hi,

Thanks a lot.

Navin

Monday, August 18, 2008 9:40 AM by Navin

# re: showModalDialog and postbacks in ASP.NET

Anyone notice how the Modal window repositions itself to its original XY location after post back.

Does anyone have an easy fix other then read/write xy coords in a cookie on unload/load.

Tuesday, August 19, 2008 2:12 PM by Steve

# re: showModalDialog and postbacks in ASP.NET

Figured it out. you need to set the window.dialogLeft and window.dialogTop on Unload to retain its position.

Wednesday, August 20, 2008 9:24 AM by Steve

# re: showModalDialog and postbacks in ASP.NET

I have got the same problem of postback with showModelessDialog. it opens a new window with url having JS code. Please provide help.

Thursday, August 21, 2008 8:11 AM by sandeepbhutani304

# re: showModalDialog and postbacks in ASP.NET

The solution proposed by MatHertel (4th comment) work also great.

thanks

Tuesday, August 26, 2008 7:29 AM by YoYo

# re: showModalDialog and postbacks in ASP.NET

thanks a lot, it helped me.

Thursday, September 04, 2008 3:29 AM by Rima

# re: showModalDialog and postbacks in ASP.NET

Thanx MatHertel ... you comments were like the words from an angel which solved my issue.

Monday, September 08, 2008 11:27 AM by Sunny

# re: showModalDialog and postbacks in ASP.NET

Thank you...this really helped me.

Friday, September 26, 2008 7:09 AM by Soumya

# re: showModalDialog and postbacks in ASP.NET

Lots of thanks man!!!

Monday, October 06, 2008 8:06 AM by Rajkumar

# re: showModalDialog and postbacks in ASP.NET

Thanks for this solution it has worked great

Tuesday, October 14, 2008 9:26 AM by Sal

# re: showModalDialog and postbacks in ASP.NET

Hi

Base/self fix worked for me a treat - spent all day trying to stop my modal windows spawning new ones...

got so exasparated that i accidently ripped of the front of my desk draw when i got one pop up to many..

fix worked and am happy :)

now to fix my desk....

I was diagnosing the problem as a IE issue as firefox handled the javascript/html as i expected from the beginning :)

Thursday, November 06, 2008 12:17 PM by ajp

# re: showModalDialog and postbacks in ASP.NET

Thank you soooo much!

Tuesday, November 25, 2008 5:13 PM by Rob B

# re: showModalDialog and postbacks in ASP.NET

Tnx dude,

You've saved me from allot of headache.

This solved my problem in 5 min.

Friday, December 05, 2008 9:41 AM by Gino

# re: showModalDialog and postbacks in ASP.NET

Thanks! This worked for me, tested in Firefox and IE7, using ASP.NET Master Pages.

As a side note, the proper HTML would be:

<base target="_self"/>

Not that the browser would really care, but... :)

Friday, December 05, 2008 9:58 AM by rally25rs

# re: showModalDialog and postbacks in ASP.NET

After using <base target="_self"> ,still ther is same problem. Page going to be refreshed and open a new window?

Please give me some solution, if any ...Thanks

Monday, December 15, 2008 7:24 AM by Sunil

# re: showModalDialog and postbacks in ASP.NET

Thanks !!!

 Got the solution !!! Working for this since morning !!!

Friday, January 02, 2009 5:59 AM by SRK

# re: showModalDialog and postbacks in ASP.NET

Thanks DATAGRID Girl - I LOVE YOU :)

Monday, January 05, 2009 2:28 PM by mike

# re: showModalDialog and postbacks in ASP.NET

I read that ShowModalDialog would eventually be phased out of IE.  Are you all still using it?  I  tried to  use the Ajax Toolkit ModalPopup instead but it does not do what I need to do.

Monday, January 26, 2009 1:32 PM by Lizzie

# re: showModalDialog and postbacks in ASP.NET

make sure to also add the following in the aspx page

<%@ OutputCache Duration="1" VaryByParam="*"%>

or you will only hit the page_load on the first click

Monday, February 02, 2009 2:16 PM by VinceB

# re: showModalDialog and postbacks in ASP.NET

Genius -  saved me hours, thanks!

Thursday, February 12, 2009 4:25 AM by Mark

# re: showModalDialog and postbacks in ASP.NET

I used <base target=_self>

It is useful

but if I want to popup a CSV in this model widows,It doesnt  work

who can tell me how should I do?

Thanks

Monday, March 02, 2009 1:49 AM by dongdong

# re: showModalDialog and postbacks in ASP.NET

use iframe, submit form target to iframe

Ex:

<form method = "" action ="" target = "hiddenFrame">

</form>

.....

<iframe name="hiddenFrame" scrolling="no" frameborder="0" width="1" height="1">

</iframe>

Monday, March 02, 2009 11:38 PM by Another solution

# re: showModalDialog and postbacks in ASP.NET

thanks, thanks, thanks, thanks, thanks, thanks, thanks, thanks, thanks, thanks.....

Monday, March 09, 2009 9:27 AM by Richard

# re: showModalDialog and postbacks in ASP.NET

What should one use in XHTML 1.1, where the base tag no longer has a target attribute?

Thursday, March 12, 2009 1:17 PM by Warren

# re: showModalDialog and postbacks in ASP.NET

Thanks, works.

For this to work

<head>

<base target="_self">

</head>

Property MaintainScrollPositionOnPostBack="True"

must be set at

the <%Page Language ....MaintainScroll....... %>

SmartNavigation is Obsolete.. But can still be effective.

Use MaintainScrollPositionOnPostBack instead.

Wednesday, April 01, 2009 1:30 PM by Reden

# re: showModalDialog and postbacks in ASP.NET

thanks i saved a lot of time, it works

Thursday, April 09, 2009 5:28 AM by Mubeen

# re: showModalDialog and postbacks in ASP.NET

I need to open the new modal dialog from modal dialog which is already open. Above solution not worked for me.

If anyone have any other solution plz help me out .....

Thanks in advance

Friday, May 08, 2009 7:58 AM by Mahesh

# re: showModalDialog and postbacks in ASP.NET

I need to implement modal windows with several form post backs. Initially, i had the problem that new windows were being spawned everytime a form post back was done inside the modal popup window. I added <base target="_self"/> to the modal windows to solve this problem but now I am getting script errors during certain postbacks in the modal windows.

If anyone has any solution to this, plz help me out,,,Thanks

Wednesday, May 13, 2009 5:08 AM by VJ

# re: showModalDialog and postbacks in ASP.NET

what if it is a master page?

Wednesday, June 03, 2009 2:39 AM by Anuja

# re: showModalDialog and postbacks in ASP.NET

Thanks... <base target="_self" /> solved my problem... its very simple but unique.

Wednesday, June 03, 2009 4:17 AM by Rajat

# re: showModalDialog and postbacks in ASP.NET

Awsome!!!! Works like a charm!!! U Rock!!! :)

Wednesday, June 03, 2009 2:21 PM by Gaurav

# re: showModalDialog and postbacks in ASP.NET

Works like a charm, solved another headache.

Monday, June 08, 2009 9:45 AM by Avishay

# re: showModalDialog and postbacks in ASP.NET

++AAAA

THANK YOU !

Monday, June 22, 2009 4:12 AM by Vİ

# re: showModalDialog and postbacks in ASP.NET

thnx very much , but now i have another problem

i can't find the opener object !!

can any 1 help ???

Wednesday, June 24, 2009 8:52 AM by mahmoud

# re: showModalDialog and postbacks in ASP.NET

Hi <base target="_self" />  works great.

But still on post back, the contents of modal window (not the modal window) shifts a little from its original position both on horizontal and vertical axis.

I am a newbee to ASP.NET. Any explanations why this behaviour ?

Wednesday, June 24, 2009 4:06 PM by Swapnil

# re: showModalDialog and postbacks in ASP.NET

Thanks Alot Marcie,

it worked greatly for me..........

Wednesday, July 29, 2009 1:37 AM by Sunilwise

# re: showModalDialog and postbacks in ASP.NET

Great discusstion, solve my problems

Saturday, August 22, 2009 10:35 PM by Lucas

# re: showModalDialog and postbacks in ASP.NET

grt i also spend 4 hours for new window problem and once again comes with title disappear problem... but this time thank god to this article....just take 5 minute...

Wednesday, August 26, 2009 2:14 AM by Harendra

# re: showModalDialog and postbacks in ASP.NET

Thanks,

  You save me. I think make load data from my aspx with JSON for resolve this problem.

Wednesday, August 26, 2009 4:08 AM by X

# re: showModalDialog and postbacks in ASP.NET

Hi,

If you should put <base target="_self" /> at the begining of head tag then, it works fine for all cases.

Navin

Thursday, September 24, 2009 5:35 PM by Navin Patel

# re: showModalDialog and postbacks in ASP.NET

Thanks...dude....solved my problem. Saved me lots of time. really appreciate it.

Friday, September 25, 2009 5:16 AM by Christopher

# re: showModalDialog and postbacks in ASP.NET

Sorry for just another thanks! after 5years you still make us happy with your post! :) Victor

Wednesday, November 18, 2009 6:25 AM by Victor de K

# re: showModalDialog and postbacks in ASP.NET

Amazing post. The problem took me hours of my work time. Also thanks everyone for the tips :D

Wednesday, November 18, 2009 6:18 PM by Chris

# re: showModalDialog and postbacks in ASP.NET

Hi, This works fine for IE 6.

But what is with IE7 ? This does not run under IE7.

Can anybody help me?

Wednesday, December 02, 2009 6:21 AM by IE7

# re: showModalDialog and postbacks in ASP.NET

I used this but doesnt seems like working, so, I used html page and IFrame to do that...and worked fine...

Monday, December 28, 2009 8:50 AM by yash

# re: showModalDialog and postbacks in ASP.NET

Hi,

Thanks for saving my time for figuring out what's going on.

I work with CRM4.0 and IE7 and the

<base target=_self>

works with my application opened in ModalDialog.

Thanks,

Mike

Tuesday, December 29, 2009 5:43 PM by Mike

# re: showModalDialog and postbacks in ASP.NET

Thanks for this tip, it works great. That saved me some searching!

Thursday, January 14, 2010 9:42 AM by Tom

# re: showModalDialog and postbacks in ASP.NET

That's work absolutely fine...

Thursday, January 28, 2010 5:44 AM by Shivi

# re: showModalDialog and postbacks in ASP.NET

excelente TIp, me ahorraste mucho tiempo de investigacion, trabaja a la perfeccion.

Gracias

Wednesday, February 03, 2010 5:01 PM by Ramo

# re: showModalDialog and postbacks in ASP.NET

Cracking - I nearly recoded the modal window and the caller as did a colleague!

Cheers folks!

Friday, February 12, 2010 7:22 AM by JohnnyB

# re: showModalDialog and postbacks in ASP.NET

great article, thanks

Tuesday, February 23, 2010 2:58 AM by romel

# re: showModalDialog and postbacks in ASP.NET

Thanks it worked...

Thursday, February 25, 2010 2:30 PM by RG

# re: showModalDialog and postbacks in ASP.NET

I put the target=_self in and it worked for IE 6 but not IE 7 or 8.  so then I moved the target=_self to be the first thing in the HEAD section instead of the last thing, and then it worked for IE 7 and 8 too.  Weird. I wouldn't think it'd make a difference.

Wednesday, March 10, 2010 1:58 PM by john

# re: showModalDialog and postbacks in ASP.NET

Excellent. Worked so well even for IE 7.

Thursday, April 01, 2010 1:03 AM by Manjula

# re: showModalDialog and postbacks in ASP.NET

Worked great, thanks for thinking about us!

:)

Friday, April 02, 2010 6:24 PM by TaffyLewis

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot!! Exactly what i was looking for..!!!

Friday, April 16, 2010 4:34 AM by Alanis

# re: showModalDialog and postbacks in ASP.NET

Finally I found the solution for my problem, its breaking my head in 2 days, Thanks a lot. Great...

Friday, April 23, 2010 4:27 PM by Johnny Taghoy

# re: showModalDialog and postbacks in ASP.NET

Many Thanks for this <base target=_self> soln

Monday, May 03, 2010 7:08 AM by subhashini

# re: showModalDialog and postbacks in ASP.NET

many thanks for this post it solved my problem which i am working for since morning you saved my day and work

Monday, May 31, 2010 8:52 AM by rahul

# re: showModalDialog and postbacks in ASP.NET

Even after 5 years, this is still helping many people. It helped me. Thanks a lot.

Tuesday, June 08, 2010 7:22 AM by Raman

# re: showModalDialog and postbacks in ASP.NET

Excellent !!!

Can anybody put the reason that why it happens ?

Thursday, June 24, 2010 3:37 PM by ashu

# re: showModalDialog and postbacks in ASP.NET

My problem was this:

window.name=something

<form target="something">

This method worked in IE8 but not in Firefox

<form target="_self">

This method worked in Firefox but not in IE8

I could only support one of the two browsers! Until...

<base target="_self" />

This works for both IE8 and Firefox 3.6

Thank you very much, Marcie!

Monday, July 26, 2010 2:33 AM by Alex

# re: showModalDialog and postbacks in ASP.NET

Thank u very much...Its working with

<base target="_parent" />

Wednesday, August 18, 2010 6:48 AM by Shailesh Daterao

# ???????? ???? showModalDialog ???? ASP.Net | ???? ???????? ?????? ?????? ????????

Pingback from  ???????? ???? showModalDialog ???? ASP.Net | ???? ???????? ?????? ?????? ????????

# re: showModalDialog and postbacks in ASP.NET

thank a looooooooooooooot

Monday, October 25, 2010 2:40 AM by Nuwan

# re: showModalDialog and postbacks in ASP.NET

Thank´s, Thank´s, Thank´s !!! So, I´m migrating a desktop system developed in VB6 to ASP.NET with MVC, and in this point I have 4 sequential modal windows opened, and in the last one, after submit my form it was opening in a new window. With <base target="_self" /> it no more occurs and the general performance of these windows was improved, I don´t know why, but.. it´s working !!!

Wednesday, November 24, 2010 11:35 AM by Samuel Vaz

# re: showModalDialog and postbacks in ASP.NET

great

Thursday, February 24, 2011 3:10 AM by dbarochia

# re: showModalDialog and postbacks in ASP.NET

Works fine, but i have a grid on the model dialog box and i am binding some data to it from database. On post back i am loosing all the data. Why is this happening?

Thursday, March 10, 2011 2:06 AM by Shekar

# re: showModalDialog and postbacks in ASP.NET

WOW it saved my time big time, I was about to change my logic and remove showModalDialog

Saturday, April 16, 2011 2:17 AM by Ashish

# re: showModalDialog and postbacks in ASP.NET

It works !!!!!!! thanks brother

Monday, May 16, 2011 3:12 AM by Tabish Matin

# re: showModalDialog and postbacks in ASP.NET

<base target="_self" /> worked great for me in ff and ie

one got-ya i discovered was if you have a target set on your form, the <base> tag didnt work and youre back to square one, so make sure you dont set a target on your form

Tuesday, June 14, 2011 9:21 PM by Kris

# re: showModalDialog and postbacks in ASP.NET

Works like a champ! Thanks!

Friday, July 29, 2011 2:49 PM by Neil

# re: showModalDialog and postbacks in ASP.NET

You saved my day :) thank a ton

Wednesday, August 17, 2011 10:52 AM by Sudheshna

# re: showModalDialog and postbacks in ASP.NET

Great helped me a lot

Thursday, August 25, 2011 3:32 AM by Rajni

# re: showModalDialog and postbacks in ASP.NET

<base target="_self" /> worked for me - thanks a bunch

Wednesday, September 21, 2011 11:57 AM by Durriya

# re: showModalDialog and postbacks in ASP.NET

its works fine. If you have master pages put

<base target="_self" /> after <title></title>

tag in the master page. It will works fine. Thanks a lot...

Friday, September 30, 2011 6:41 AM by Aj

# re: showModalDialog and postbacks in ASP.NET

Many thanks, works like a charm.

Monday, October 17, 2011 8:24 AM by Michael

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot!

It saves lots of time

Friday, December 09, 2011 6:35 AM by smartymca

# re: showModalDialog and postbacks in ASP.NET

You saved my day, thanks heaps!!

Tuesday, December 20, 2011 10:01 PM by Renu

# re: showModalDialog and postbacks in ASP.NET

Bloody hell I spent ages on this. Can't believe there was such a simple fix. Thank you.

Thursday, December 22, 2011 7:07 AM by Dan

# showModalDialog Opens a New Window on Submit or location.href &laquo; Justin Cooney &#8211; Programming Tips

Pingback from  showModalDialog Opens a New Window on Submit or location.href &laquo; Justin Cooney &#8211; Programming Tips

# re: showModalDialog and postbacks in ASP.NET

Thanks a ton.

<base target="_self" />

works for me.

Friday, January 06, 2012 4:07 AM by Pradeep

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot, this resolved my problem!!!

Monday, January 16, 2012 6:13 AM by Rohan Pathak

# re: showModalDialog and postbacks in ASP.NET

Yesssss Worked for me.

Thanks Friend.

Sunday, January 22, 2012 2:55 AM by Abhijeet

# re: showModalDialog and postbacks in ASP.NET

you are genious, i spent so much time breaking my head. thanks so much.. thanks again :)

Friday, January 27, 2012 7:15 AM by Sweety

# re: showModalDialog and postbacks in ASP.NET

thanks man it did work for me.

Friday, January 27, 2012 10:34 AM by nat

# re: showModalDialog and postbacks in ASP.NET

<base target="_self" />

is not applicable for modelpop's. Use hidden frames as target in form. It will solve the problem

Wednesday, February 15, 2012 1:25 AM by kailash

# re: showModalDialog and postbacks in ASP.NET

  <form id="form1" runat="server" target = "hiddenFrame">

  <iframe name="hiddenFrame" scrolling="no" frameborder="0" width="1" height="1">

</iframe>

Used this above code.it will work for modelpopup's

Wednesday, February 15, 2012 1:30 AM by Malar

# re: showModalDialog and postbacks in ASP.NET

Thanks a lot...

Thursday, February 16, 2012 3:54 PM by shansubra

# re: showModalDialog and postbacks in ASP.NET

Excellet. but not working.

Monday, February 20, 2012 12:11 PM by ram

# re: showModalDialog and postbacks in ASP.NET

Thx for this tips. Found it in a good moment!

Bdw, it works under IE 8.

Thursday, February 23, 2012 12:16 PM by MR

# re: showModalDialog and postbacks in ASP.NET

saved my night, almost banged my head on the wall. thank you

Monday, February 27, 2012 2:14 AM by RogerC

# re: showModalDialog and postbacks in ASP.NET

I am new to web and always been developing desktop apps and now I have to build a web app. I need to build a page that is modal and by closing getting some responds back from the page. Could someone please help me with this issue?

Could some please post the entire code?

my email address is mehrdada@telus.net

Thanks a lot guys

Sunday, March 04, 2012 12:13 PM by mehrdad

# re: showModalDialog and postbacks in ASP.NET

If  i open SP Model dailog with html option. Button post back not working. Can u please share an example

Thursday, May 03, 2012 4:32 AM by Anand

# re: showModalDialog and postbacks in ASP.NET

Great help! on SP Modal Dialog.

Friday, December 07, 2012 7:33 AM by sushama

Leave a Comment

(required) 
(required) 
(optional)
(required)