473,402 Members | 2,072 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

ShowModalDialog postback - SOLUTION

Windows IE
..NET

PROBLEM:
After invoking showModalDialog(), a form comes up, the user clicks
submit, and a NEW webpage opens.

SOLUTION
After reading numerous posts that say, paraphrased, "This can't be
done, you have to use IFRAMES", I thought I just post a solution.
Lets be careful with the "cannot be done" posts.

All you need to do is put this code in the <HEAD> of your modal page:
<SCRIPT LANGUAGE="JScript">
window.name="modal";
</SCRIPT>

and target="modal" in your modal <FORM> tag. No need for IFRAMES.

Also, when calling the showModalDialog, pass in a random number as a
querystring parameter. This will ensure that the modal won't cache
like they love to do.

var myRand = rand(50000);
var modal = window.showModalDialog('mypage.aspx?rand='+myRand, 0,
windowoptions);

RANDOM FUNCTIONS
function rnd() {
today=new Date();
jran=today.getTime();

ia=9301;
ic=49297;
im=233280;
jran = (jran*ia+ic) % im;
return jran/(im*1.0);
}

function rand(number) {
return Math.ceil(rnd()*number);
}

Hope that helps,

Jinx
http://www.JinxGear.com
Nov 18 '05 #1
0 2166

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
0
by: MikeB | last post by:
This post is not about postbacks opening a new window from a showModalDialog window. I am using a modal dialog to populate a textbox in my form. When the form is submitted the code behind logic...
7
by: Shaul Feldman | last post by:
Hello, I'm trying to change the page in the modal window opened with openModalDialog. The page change must be done from the modal window itself WITHOUT postback. For now I have problems since it's...
2
by: Henry Johnson | last post by:
I'm currently opening an aspx page (myModalASPX) as a dialog box from client-side script using window.showModalDialog(blah blah blah). The dialog opens as expected. Now I'm adding functionality...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
3
by: needin4mation | last post by:
Hi, I have an asp:button that has a ShowModalDialog script attribute added to it. When the ShowModalDialog opens the user is supposed to select some data which is then sent back to the calling...
2
by: Sarah | last post by:
I am using the javascript showModalDialog function to open a file upload window. The function opens a page which contains a usercontrol housing the file upload stuff. The control works fine when...
1
by: Axford | last post by:
Hello, when I use the IE javascript 'showModalDialog' function to display a calendar I encouter the following problem: My aspx page uses a master page (asp.net 2.0). My 'showModalDialog' opens...
0
by: nilayb | last post by:
Hi All, I am unable to get the page title after postback of the modal window using window.showmodaldialog. First time it displays the title but after postback event it doesnt. i am using C# ,.net...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.