473,698 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to refresh page after calling showModalDialog

I have Search form that allows users to retrieve records into a
DataGrid. There are two search criteria - a Month and a Year, which
are selected from drop-down lists. There is a server-side button
called "cmdFilter" which retrieves data from the database using any
criteria thus selected.

For any of the records retrieved into the grid match certain
conditions, one of the columns will be formed into a hyperlink.
Clicking on this will allow the user to display a modal dialog, at
which point the user can manipulate the data displayed.

The hyperlink is created server-side like so (in the ItemDataBound
event):

Dim drv As DataRowView = CType(item.Data Item, DataRowView)
Dim Rule As String = CType(drv.Item( 0), String)
Return "<a style='COLOR:bl ack' href='javascrip t:ShowUploadInf o(""" &
Rule & """)'>Uploa d</a>"
When the user closes the pop-up, I'd like the underlying form to be
refreshed.

Here's what I've done.

In the .aspx file for the Search form (the "parent" or "calling" form)
I have the following:

function ShowUploadInfo( uploadDate) {

// Save search variables
//document.all.it em("txtHiddenSt artDate").value =
document.all.it em("txtStartDat e").value;
//document.all.it em("txtHiddenEn dDate").value =
document.all.it em("txtEndDate" ).value;
//document.all.it em("txtHiddenMo nth").value =
Number(document .getElementById ('cboCalendarMo nth').value);
//document.all.it em("txtHiddenYe ar").value =
Number(document .getElementById ('cboCalendarYe ar').value);

var str =
window.showModa lDialog('../Popups/UploadInfo.aspx ?uploadDate=' +
uploadDate,'',
'dialogHeight:8 00px;dialogWidt h:805px;status= no,toolbar=no,m enubar=no,resiz able=no,locatio n=no,scrollbars =no','','unador ned:yes');

// POINT 1 POINT 1 POINT 1 POINT 1 POINT 1 POINT 1 POINT 1 POINT 1
if (!str)
{
str = "";
}

if (str.length == 0)
{
return;
}
else
{
debugger;
// attempt to execute cmdFilter.Click event in VB code behind
document.all.it em("cmdFilter") .click();
}
// POINT 2 POINT 2 POINT 2 POINT 2 POINT 2 POINT 2 POINT 2 POINT 2
}

and in the "child" or "popup" form I have:

<body onunload="SetUp CallingPage()">

<SCRIPT language="javas cript" id="Custom2">
<!--
function SetUpCallingPag e()
{
window.returnVa lue = 1;
}
//-->
</SCRIPT>

The problem I'm having is twofold.

Running as it is, when the pop-up is closed there is a postback of some
sort on the "parent" or "closing" form, but the code at
document.all.it em("cmdFilter") .click(); IS NOT CALLED - at least, the
breakpoint at the start of the code is not hit (unlike, say, if I click
on the button). Also, all the values that have been entered into the
criteria controls (month and year) are lost or, rather, reset to their
default values.

If I remove the code between POINT 1 and POINT 2, it all seems to work
well. The pop-up is displayed, the data can be manipulated in the
pop-up, but of course when the pop-up is closed the "parent" or
"calling" form is not refreshed or posted back to reflect changes to
the underlying data. However, unlike in the above scenario the
controls on the form remain unchanged.

I tried using location.reload (true); in place of the
document.all.it em("cmdFilter") .click(); but I got a message box which
the clients won't like. I've also tried saving the criteria to a group
of hidden controls and retrieving them in the code-behind, but since
the code behind doesn't seem to be hit by the

document.all.it em("cmdFilter") .click();

there's little likelihood that this will work.

Has anyone any ideas where I'm going wrong? It's driving me nuts!

Anyway, happy Christmas (or whatever) to all our readers.

Edward

Dec 23 '05 #1
0 2384

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

Similar topics

2
4596
by: Jonathan | last post by:
Hi, i am trying to refresh a ShowModalDialog that contains information. I have search about it but it never seems to be possible. As anybody got some info., way, idea, documentation about a ShowModalDialog refresh. i really dont have any idea :*( Any help would be SOOOOOOOOOO appreciated ! Thanks in advance! Jonathan
2
16131
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 showModalDialog. It is modal as far as the client is concerned but not the server... In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
5
3572
by: Tmajarov | last post by:
Haven't been able to find a clear answer to this... I am building an asp.net application and trying to enforce some work flow by displaying a form via the showmodaldialog method. I can get the form to display, etc. But I want to refresh the content of the form displayed in the dialog window without navigating away from the form. For example... the showdialog method opens up a record to be edited. After editing when the save(submit)...
2
2992
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 tested independently, but when called through showModalDialog on submit, another window is opened (a fullsize version of the page passed to showModalDialog). Is this a bug, by design, or have I made some sort of error? thanks
1
1940
by: desmcc | last post by:
Hi, I am launching a modal dialog through the usual javascript (window.showmodaldialog). When the modal dialog is complete (ie user selects OK), the calling page then refreshes itself by setting the location.href of the window to be itself (ie the modal dialog changes a label on the calling page ). I can see that this causes the page load code of the calling page to execute in the code behind page. I can also see clearly that this updates...
0
1836
by: teddysnips | last post by:
I have Search form that allows users to retrieve records into a DataGrid. There are two search criteria - a Month and a Year, which are selected from drop-down lists. There is a server-side button called "cmdFilter" which retrieves data from the database using any criteria thus selected. For any of the records retrieved into the grid match certain conditions, one of the columns will be formed into a hyperlink. Clicking on this will...
7
8704
by: Ben Schumacher | last post by:
How can I refresh the parent page from a popup window that was created using window.showmodaldialog? I would like to accomplish this using vbscript if possible.
3
3577
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup and then do a refresh of the calling form. Any ideas on how to get a reference to the calling form? I tried window.parent.location.reload() , but it doesn't work. Thanks a lot.
5
4393
by: knowdotnet | last post by:
Hi all, Which is the best way to return a value back to the web page from a pop up page? I have a asp.net web application which opens a popup page on a link button click. The Link button is contained in a datagrid column. When i submit the popup page I want a value from the page to be returned to the parent page and is to be updated in a dataset, thereby updating the datagrid. I want the parent page to be refreshed on submitting the pop...
0
8610
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8902
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7740
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.