473,395 Members | 1,678 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,395 software developers and data experts.

REPOST: 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.DataItem, DataRowView)
Dim Rule As String = CType(drv.Item(0), String)
Return "<a style='COLOR:black' href='javascript:ShowUploadInfo(""" &
Rule & """)'>Upload</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.item("txtHiddenStartDate").value =
document.all.item("txtStartDate").value;
//document.all.item("txtHiddenEndDate").value =
document.all.item("txtEndDate").value;
//document.all.item("txtHiddenMonth").value =
Number(document.getElementById('cboCalendarMonth') .value);
//document.all.item("txtHiddenYear").value =
Number(document.getElementById('cboCalendarYear'). value);

var str =
window.showModalDialog('../Popups/UploadInfo.aspx?uploadDate=' +
uploadDate,'',
'dialogHeight:800px;dialogWidth:805px;status=no,to olbar=no,menubar=no,resiz*able=no,location=no,scro llbars=no','','unadorned: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.item("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="SetUpCallingPage()">

<SCRIPT language="javascript" id="Custom2">
<!--
function SetUpCallingPage()
{
window.returnValue = 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.item("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.item("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.item("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

Jan 3 '06 #1
0 1817

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

Similar topics

2
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...
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...
2
by: Paul | last post by:
Tried to post this hours ago, but it still isn't visible. If it's a repeat, sorry for the inconvenience. Hello, all --- Environment: Visual Studio.NET 2003 (C#); Windows 2003 Server; IIS 6.0...
5
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...
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...
0
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...
7
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
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
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...

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.