Reload parent window when popup is two levels away

Hi all

I cannot seem to find anyone who can help me with this, so it must be really difficult. And I am not sure why. So here goes.

I have a file submission routine. First there is the default.aspx page where files are listed. To upload a file, you click on a submit file button. This button calls up a confirmation and agreement window (SubmitFile.aspx) as a popup. After agreement, you click on the "Next>" button and get the file upload page (called FileUpload.aspx). So now we are two windows away from the original default.aspx page.

The FileUpload.aspx page has a lengthy server-side script that uploads the submitted file to a SQL database. The script is done in vb.net, NOT javascript. It is runat="server".

So now comes the challenging part. After the file is uploaded, I want to reload to root parent page which is to say the default.aspx page so that the new file upload is shown on the page.

On the fileupload.aspx page, I use the onclick event to call the sub for the file uploading (remember, it's runat="server"). Therefore I have the onclientclick event available for client side processing. At least I think that is how it should work, but I am not sure.

What code should I use to refresh the two level down parent page (default.aspx) from the FileUpload.aspx page. Should I do it from the onclientclick event using javascript (I think I have to)? If so, what would that java script look like?

Thanks

Richard

0
RMcBride
5/2/2009 3:18:07 AM
asp.net.client-side 24353 articles. 1 followers. Follow

14 Replies
935 Views

Similar Articles

[PageSpeed] 21

 Try this

'register the client side javascript


        Dim strScript As String = ""
        strScript &= "<script language=JavaScript id='MyScript'>" & vbCrLf
        strScript &= "window.opener.document.forms['aspnetForm'].submit();" & vbCrLf
        strScript &= "<" & "/script>" & vbCrLf

        If (Not ClientScript.IsStartupScriptRegistered("MyScript")) Then
            ClientScript.RegisterStartupScript(Me.GetType, "MyScript", strScript)
        End If

Reply me for any further query

Regards

Asif


Please remember to click “Mark as Answer” on the post that helps you.
This can be beneficial to other community members reading the thread.
0
asifchouhan
5/2/2009 5:19:32 AM

Hi Asif

Where would I place this script and how would I cause it to execute?

Thanks

Richard

0
RMcBride
5/2/2009 5:24:17 AM

 From where you are going back to the parent window

Create an sub procedure and place the above script in it and call when you are redirecting to parent window.

 

Regards

Asif


Please remember to click “Mark as Answer” on the post that helps you.
This can be beneficial to other community members reading the thread.
0
asifchouhan
5/4/2009 5:39:26 AM
Hi Asif

It appears that this does not work.

I created a sub routine called RefreshParent inside the vb script block for (but separate from) the data submission routine. I pasted the code into that sub, and called that sub from the data submission sub.

The root page was not reloaded.

Sorry.

Richard
0
RMcBride
5/4/2009 4:05:13 PM

Hi Asif

I see where the problem is. You say "call when you are redirecting the the parent window". My site doesn't work that way. After data submission the popup opens a confirmation window where members can either submit another file or close that window. In other words the data submission routine does NOT return to the parent page.

However the parent page should refresh immediately after the file submission as a visual cue to users that their file is now on the site. Thus the page refresh has to be a call immediately after data submission, and before the Response.Redirect.

Thanks

Richard

0
RMcBride
5/4/2009 4:19:09 PM

probably something like this

 window.opener.window.opener.reload(true);

 In this day in age, I would not touch a pop up window with a 10 foot pole.

 Eric


Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
5/4/2009 5:47:23 PM
Your suggestion doesn't work. 

Thanks
0
RMcBride
5/4/2009 6:16:23 PM

RMcBride:
Your suggestion doesn't work. Thanks
 

And the error you get would be?

Eric


Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
5/4/2009 6:28:38 PM

Add to the main page:

<script type="text/javascript">
<!--
function updateParent()
{
 // Change "this" to "Me" for VB...
 <%= ClientScript.GetPostBackEventReference(this, "UpdateFromChildPagePostBack") %>;
}
// -->
</script>

Add to each child page, and call in the LAST child page (the one to cause the update on the parent):

<script type="text/javascript">
<!--
function updateParent()
{
 window.opener.updateParent();
}
// -->
</script>

NC...

0
NC01
5/4/2009 6:29:17 PM

 ah....thinking about what I typed, should have been ....opener.location.reload(true);

 Eric


Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
5/4/2009 6:35:10 PM

Hi NC01

Your instructions to "add to each child page, and call in the LAST child page (the one to cause the update on the parent)" are in conflict. The LAST child page is NOT the one to cause the refresh on the parent. The SECOND TO LAST page should cause the refresh on the parent, immediately after the file upload. The LAST page allows them to restart the article posting process.

thanks

Richard

0
RMcBride
5/4/2009 6:44:11 PM

Hi Eric

That was the first thing I tried, in the onclientclick event of the button for file submission. It didn't work, perhaps because it was calling a root page two levels back, and not the immediate parent window.

thanks

Richard

0
RMcBride
5/4/2009 6:46:19 PM

 if it is the immediateparent window, it is just window.opener.

 I am confused on what you are doing since you made it seem like you wanted to call it from the 2nd child and

 grandparent [original window] <--> parent [first pop up] <--> child [second pop up]

who is doing what?

Eric


Pascarello.com | Twitter epascarello | LinkedIn
0
A1ien51
5/4/2009 9:12:59 PM
Hi Eric

   
  1. 1. User opens default page and clicks on "Submit Article" hyperlink.
  2. 2. "Submit Article" button calls NavigateURL to "SubmitAgreement" page where user must agree to conditions before submitting article.
  3. After clicking "I Agree" checkbox, a "Next>" button is activated, opening "FileUpload" in the same window.
  4. User selects file and clicks on "Submit" Button. Submit button calls server-side script to store file in SQL database and file is submitted.
  5. After submitting file, Response.Redirect opens ArticleSubmitted page in the same popup window, confirming submission and allowing user to either return to sumbission routine or close window.

What I need is an element at the end of Step 4 - FileUpload, where the "grandparent" default.aspx page is refreshed. This will serve as a visual cue to the user that their file has been submitted. It is important to do it here, as there may be other files to follow via a repeat of the steps.

Thanks

Richard

0
RMcBride
5/4/2009 11:27:59 PM
Reply:

Similar Artilces:

reloading parent window from popup window
Hi, I am developing asp.net web application which open up in IE, in a page of the application i have a link to open a new IE window to give the results (using javascript:window.open()). I have a link in the newly opened window, if user click that link, the current window should be closed and the first IE window should be reloaded or redirected to another address automatically. Like to use javascript. Is it possible? If so, please advice me. Many thanks, Renu          Hi, u may call this javascript while clicking the control in the popup window functio...

popup window to parent and parent to popup
HI I have parent window when i click the link in the parent window it will give me popup window and there some other links(code is below) in popup window. when i click them it has to go to parent window where should i write the code and what should i write <asp:DataList ID="dlTopTenResults" runat="server" Width="100%"> <ItemTemplate> <table > <tr> <div style ="border-bottom: 1px solid #E7E2B8; height:1px;"> <td width="7%" valign="middle"><span class="story_in_page_title"...

Loading data from popup to parent window without refreshing the parent window.
Hi all, I have a requirement to pass data from a popup window to the parent window. There is an order entry screeen. The user has to select a customer before entering the order. On clicking the search customer button, a popup will open up where the user can do the search. The user will select a customer and the selected customer details should be passed back to the parent window without refreshing the parent window. How can this be accomplished? Kindly help me as this is a very urgent requirement. hello.- not really an ajax question. lots of examples out there that show this. here'...

reload parent page with parameters from popup windows
I am trying to reload parent page with parameters.step to problem.1. I created parent page (A) having one hyperlink in that.2. When I click on hyperlink, one HTML window (B) will popup with some data in gridview will display on that with Hyperlinks.                   -----------------------------------------------------------------------------------------               |    1   www.yahoo.com    ...

Datagrid: delete event getting fired on parent window when reloading parent from child window
Hi, I have a web form with a Add button and a datagrid with a delete column. On click of Add button I open a popup enter values on form and submit… on submit I reload the parent window. Now suppose I added a date 2/2/06 from popup, this date gets displayed in the datagrid. Now I delete this date using the Delete from the datagrid. Now I again click on add and try to add 2/2/06, what happens is the date gets added on submit but when the parent window reloads the date gets removed.  I have no idea how the delete is again getting fired on reload.  Thanks in advance. Dharmendra ...

Refreshing Parent page from Popup window,vb.net
Hello  Friends, I am working in Vb.net I am having a problem of refreshing a parent page from a pop up window: Scenario: Parent page has a dropdown list which needs to be toggled on and off by selecting the checkbox in the pop up window, and then refreshing the parent page, i am able to do it but not through pop up window , so can anyone give useful suggestions. Thanks alot for viewing this post and suggestions will be appreciated. Try to use the below code in your child window Page.ClientScript.RegisterStartupScript(me.GetType(),"refresh","var url = window.opener.location.href;...

Popup Window + Redirect Parent Window + Bind Child Window Data
I wish to achive something as below:1. Popup a child window Child1 from parent window Parent1 (Done)2. Click a button on Child1, redirect the Parent1 to Parent2 (Done)3. In Parent2, I want to bind the labels with the data from Child1 labels.4. Close the Child1 (Done)How can i achieve for Task 3???? Willing for your answers.. -- Tough People Do Tough Task -- Name Child1 when you open the window: window.open("{Your URL}", "Child1", "{Your window options}"); Get a reference to Child1 from Parent2: var winRef = window.open("", "Child1", ""); Use the reference to call a javascript metho...

Popup cause parent window reload => prevent validation
Hi all,After the user did some action in a popup window I want to reload the parent window and i am doing this with"window.opener.document.forms[0].submit"Of course all the validators of the parent page are firing without knowing that the input action already too place in the popup window. So do i have to write a custom routine to disable the validators or is there a built in mechanism?So I guess i have to insert some js functions which calls ValidatorEnable on the clientside. In addition to this i could set a flag within a control and check it on the serverside id i should apply v...

Control parent window from Popup window
Hi I open a popup window by clicking a button in a form. I want that, as soon as the popup window is closed the parent window should navigate to a another page. Be nice to geeks, you might end up working for onePlease hit "MARK AS ANSWER" if I made you smile today ;) To access the parent you can use "opener". opener.document.location.href = 'http://www.asp.net';Shane BauerMCP - ASP.NET hi, the parent window:   <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick ="PopupWindow()"/>  <script type ="text/javascript" >   ...

Popup window values in parent window
 I have a linkButton on page1.aspx. On the OnClientClick Event of linkbutton i opens new window. Page2.aspx. On page2.aspx I have textbox and button contol. On the OnclientClick of Button in page2 i want textBox value into the parent page .TextBox. i have written following JavaScript. Please Help me. My Code is Here. In page1.aspx On ClientClick of LinkButton this Function calls. function newWin() {    window.open('page2.aspx','name','height=820,width=850'); } // Function to be called from Child Window function update(e...

forms authentication and client side window popup of secured page?
Hi, I have a asp.net 1.4 web application using forms authentication.The users log into the site using LDAP and get a forms authentication cookie put onto their local machine. This allows the users to visit "secured pages" on the site. A secured page is a page that is any page found inside the secured directory. I have a secured webforms with drop down boxes that a user fills out. After filling out they hit a server control button to response.redirect to a secured crystal report. The problem is I have created a second button to do a client side window popup to a new browser window of the ...

To Close Popup Window from Parent window
Hai All, I have a Problem. I use Window.open(); to open a new window when open button is Clicked from Parent Window. What i need is , i have another Button CLOSE in the Parent window.If i click the Close Button i need to close the Popup Window is any way to solve this Problem. Regards, Karthik.A you should open new window like this : mywin=window.open(....); then you have an object named mywin that refers to new opened pop up menu. then this code must be runned to close it : mywin.close(); Good Luck A.K.S Hai AKS, I treid this tooooooo. But i cou...

how to get value from client side script Prompt window to a session var in .net
hi guyz, i hav a problem with getting a value from a client-side inputbox to a session var in .net. is this possible? however, when i click submit button this is the code that's triggered. dim sb as New System.Text.StringBuilder sb.append("<script language=" & """" & "vbscript" & """" & ">") sb.append(vbcrlf) sb.append(vbcrlf) sb.append("do while xLate =" & """" & """") sb.append(vbcrlf) '//prompt window, val...

How to pass parameter from a popup window to its parent window?
I have a mailing.aspx page for emailing attachment. Since FulUpload control does not reveal the full path of the .jpg file on the client's computer, I am going to upload it to my web server first and then do the attachment that way. So for the upload, on the mailing.aspx page I have a btnAttachment button. When the user click on this btnAttachment button, a new window (fileUpload.aspx) popup for the user to upload the files. The problem I'm facing right now is, when the files are successfully uploaded to the ~/myUploads/ folder, how do I pass the file names of those files from the ...

Web resources about - Reload parent window when popup is two levels away - asp.net.client-side

Reload (Tom Jones album) - Wikipedia, the free encyclopedia
Reload is an album by Welsh singer Tom Jones , released in 1999. After a lengthy career, and a notable absence from the music charts for several ...

Lamestream Media: Reload or White Flag?
“Let’s keep pivoting around media bias, and not get distracted with the vulgar personal shots. Call out lies and set the record straight, but ...

Facebook introduces universal gift card that friends can reload for different retailers
Facebook today announced the Facebook Card, a resusable gift card that can be loaded with balances for different retailers when a user’s friends ...

RPG Reload TA (@RPGReload) on Twitter
Nameless: The Hackers RPG is free for Cyber Monday. itunes.apple.

The "MW2 Gluke" - Impossible Reload - YouTube
Had this concept in mind and just had to make it. I have to say that luck was on my side. I pushed through the clip draw part and it ended up ...

Palin reloads over guns, stays soft on soda
Sarah Palin's appearances no longer inspire speculation about her presidential aspirations but her reception at a large gathering of conservatives ...

Carlton young guns get to reload in VFL
Carlton young guns get to reload in VFL

Australia reloads as gun amnesties fail to cut arms
AUSTRALIANS own as many guns now as they did at the time of the Port Arthur massacre, despite more than 1 million firearms being handed in and ...

Dumping an open source Honeypot on Rachel: FTC reloads on liquidating robocallers
The Federal Trade Commission today announced the rules for its second robocall exterminating challenge, known this time as Zapping Rachel Robocall ...

Civic bar Reload to host first speed-dating event for video game lovers
Any single person will be the first to tell you that Canberra isn't a single-friendly city.

Resources last updated: 12/8/2015 3:34:15 PM