473,705 Members | 6,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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,locati on=no,scrollbar s=no','','unado rned: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

Jan 3 '06 #1
0 1840

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
16135
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
2
2224
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 Here is the problem I am having. I have created a web custom control in C# which includes a datagrid, label, and code to support populating and paging the datagrid. The dataset which contains the data displayed in the datagrid
5
3575
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
2993
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
0
2388
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
8705
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
4395
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
8768
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8690
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
9274
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
9034
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,...
1
6606
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5933
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2491
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2083
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.