473,705 Members | 7,139 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parent widows refresh

1) I have a C# web application and what I am trying to do is create a popup window from a link on the parent window
2) the popup window will have a button and when a user clicks on the button the program should update a database, close the window and refresh the parent window.

My question is does anyone have a example of popup window wich will close it's self and refresh the parent window when a user clicks on a button?

I know there are countless examples of this with Java script, but I can get any of them working with ASP.NET. The biggest problem I have is with refreshing the parent window.

I have tried the following code in the popup window in the button click event, but I keep getting java script error:
'window.opener. document' is null or not an object.

this code is in the
private void butSave_Click(o bject sender, System.EventArg s e) {

string jscript = "<script language=\"java script\">" +
"window.opener. refresh();" +
"</script>";
Literal1.Text = jscript;

}

Thanks

Peter

Nov 19 '05 #1
5 4600
try using
document.window .opener.locatio n='abc.aspx';
this code will open that page again and in other words will refresh it ;
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:eE******** ******@tk2msftn gp13.phx.gbl...
1) I have a C# web application and what I am trying to do is create a popup
window from a link on the parent window
2) the popup window will have a button and when a user clicks on the button
the program should update a database, close the window and refresh the
parent window.

My question is does anyone have a example of popup window wich will close
it's self and refresh the parent window when a user clicks on a button?

I know there are countless examples of this with Java script, but I can get
any of them working with ASP.NET. The biggest problem I have is with
refreshing the parent window.

I have tried the following code in the popup window in the button click
event, but I keep getting java script error:
'window.opener. document' is null or not an object.

this code is in the
private void butSave_Click(o bject sender, System.EventArg s e) {

string jscript = "<script language=\"java script\">" +
"window.opener. refresh();" +
"</script>";
Literal1.Text = jscript;

}

Thanks

Peter
Nov 19 '05 #2
Thanks for your help!

but I have tried this already and getting the same error
'window.opener. document' is null or not an object.

"Rai Yawar Ijaz" <yi***@xavor.co m> wrote in message
news:uB******** ******@TK2MSFTN GP14.phx.gbl...
try using
document.window .opener.locatio n='abc.aspx';
this code will open that page again and in other words will refresh it ;
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:eE******** ******@tk2msftn gp13.phx.gbl...
1) I have a C# web application and what I am trying to do is create a
popup
window from a link on the parent window
2) the popup window will have a button and when a user clicks on the
button
the program should update a database, close the window and refresh the
parent window.

My question is does anyone have a example of popup window wich will close
it's self and refresh the parent window when a user clicks on a button?

I know there are countless examples of this with Java script, but I can
get
any of them working with ASP.NET. The biggest problem I have is with
refreshing the parent window.

I have tried the following code in the popup window in the button click
event, but I keep getting java script error:
'window.opener. document' is null or not an object.

this code is in the
private void butSave_Click(o bject sender, System.EventArg s e) {

string jscript = "<script language=\"java script\">" +
"window.opener. refresh();" +
"</script>";
Literal1.Text = jscript;

}

Thanks

Peter

Nov 19 '05 #3
i guess that when u opened the window u havnt passed the information of the
parent page i mean submiting its handle to the popup
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:#b******** ******@TK2MSFTN GP14.phx.gbl...
Thanks for your help!

but I have tried this already and getting the same error
'window.opener. document' is null or not an object.

"Rai Yawar Ijaz" <yi***@xavor.co m> wrote in message
news:uB******** ******@TK2MSFTN GP14.phx.gbl...
try using
document.window .opener.locatio n='abc.aspx';
this code will open that page again and in other words will refresh it ;
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:eE******** ******@tk2msftn gp13.phx.gbl...
1) I have a C# web application and what I am trying to do is create a
popup
window from a link on the parent window
2) the popup window will have a button and when a user clicks on the
button
the program should update a database, close the window and refresh the
parent window.

My question is does anyone have a example of popup window wich will close it's self and refresh the parent window when a user clicks on a button?

I know there are countless examples of this with Java script, but I can
get
any of them working with ASP.NET. The biggest problem I have is with
refreshing the parent window.

I have tried the following code in the popup window in the button click
event, but I keep getting java script error:
'window.opener. document' is null or not an object.

this code is in the
private void butSave_Click(o bject sender, System.EventArg s e) {

string jscript = "<script language=\"java script\">" +
"window.opener. refresh();" +
"</script>";
Literal1.Text = jscript;

}

Thanks

Peter


Nov 19 '05 #4
i guess that when u opened the window u havnt passed the information of the
parent page i mean submiting its handle to the popup
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:#b******** ******@TK2MSFTN GP14.phx.gbl...
Thanks for your help!

but I have tried this already and getting the same error
'window.opener. document' is null or not an object.

"Rai Yawar Ijaz" <yi***@xavor.co m> wrote in message
news:uB******** ******@TK2MSFTN GP14.phx.gbl...
try using
document.window .opener.locatio n='abc.aspx';
this code will open that page again and in other words will refresh it ;
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:eE******** ******@tk2msftn gp13.phx.gbl...
1) I have a C# web application and what I am trying to do is create a
popup
window from a link on the parent window
2) the popup window will have a button and when a user clicks on the
button
the program should update a database, close the window and refresh the
parent window.

My question is does anyone have a example of popup window wich will close it's self and refresh the parent window when a user clicks on a button?

I know there are countless examples of this with Java script, but I can
get
any of them working with ASP.NET. The biggest problem I have is with
refreshing the parent window.

I have tried the following code in the popup window in the button click
event, but I keep getting java script error:
'window.opener. document' is null or not an object.

this code is in the
private void butSave_Click(o bject sender, System.EventArg s e) {

string jscript = "<script language=\"java script\">" +
"window.opener. refresh();" +
"</script>";
Literal1.Text = jscript;

}

Thanks

Peter


Nov 19 '05 #5
How do I submitt the handle to the pupup?
Here's a sniplet of my code:
//On the parent page I have the following code in the Parent.aspx file

//
//
//
c.Controls.Add( new LiteralControl( "<a href=" + q + "javascript ://\" onclick=\"javas cript: return modalWin('Popup .aspx?Page=CalE vent.aspx')\">t est</A>"));

// the following code is in the Popup.aspx file:

Literal1.Text = "<IFRAME NAME='embeddedF rame'" +
" WIDTH='100%' HEIGHT='100%' SRC='" +
Request.Params["Page"] + Params + "' if(self.parent. frames.length != 0) self.parent.loc ation=document. location;/>";

// This code is in the CalEvent.aspx file:

string strjscript = "<script language=\"java script\">" +
"window.opener. document.URL='h ttp://www.microsoft.c om';window.clos e();"+
"</script>";
Literal1.Text = strjscript;

"Rai Yawar Ijaz" <yi***@xavor.co m> wrote in message news:u4******** ******@TK2MSFTN GP10.phx.gbl...
i guess that when u opened the window u havnt passed the information of the
parent page i mean submiting its handle to the popup
"Peter" <pczurak@.nospa m.nospam> wrote in message
news:#b******** ******@TK2MSFTN GP14.phx.gbl...
Thanks for your help!

but I have tried this already and getting the same error
'window.opener. document' is null or not an object.

"Rai Yawar Ijaz" <yi***@xavor.co m> wrote in message
news:uB******** ******@TK2MSFTN GP14.phx.gbl...
> try using
> document.window .opener.locatio n='abc.aspx';
> this code will open that page again and in other words will refresh it ;
> "Peter" <pczurak@.nospa m.nospam> wrote in message
> news:eE******** ******@tk2msftn gp13.phx.gbl...
> 1) I have a C# web application and what I am trying to do is create a
> popup
> window from a link on the parent window
> 2) the popup window will have a button and when a user clicks on the
> button
> the program should update a database, close the window and refresh the
> parent window.
>
> My question is does anyone have a example of popup window wich will close > it's self and refresh the parent window when a user clicks on a button?
>
> I know there are countless examples of this with Java script, but I can
> get
> any of them working with ASP.NET. The biggest problem I have is with
> refreshing the parent window.
>
> I have tried the following code in the popup window in the button click
> event, but I keep getting java script error:
> 'window.opener. document' is null or not an object.
>
> this code is in the
> private void butSave_Click(o bject sender, System.EventArg s e) {
>
> string jscript = "<script language=\"java script\">" +
> "window.opener. refresh();" +
> "</script>";
> Literal1.Text = jscript;
>
> }
>
> Thanks
>
> Peter
>
>



Nov 19 '05 #6

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

Similar topics

11
41204
by: HolaGoogle | last post by:
Hi, Sorrryy to ask such basic question but i do need your help! Here's what i'm trying to do: In my parent form i'm calling a my Iframe form to get certain value, then depending on that value enable or disable my submit button in my parent form without using any refresh/reload or submit button in my form. Looks realy simple but i don't know how to get it work. actualy, i've been able to populate listbox,text boxes in my parent with...
1
10108
by: Winfried Koenig | last post by:
Hi everyone, I have a main page: -------------------------------------------------- <html><head><title>Test</title> </head><body> <img id="img_a" name="img_a" src="image_1.png" alt=""><br>
2
1857
by: Bill S. | last post by:
Hey, I am trying to figure this out. The hyperlinks on my page open up a small popup window. I have no reason to refresh the parent page or what have you. I was living in a very happy world, with no problems or disturbances. However, a problem has since arisen: The search engines have indexed these popup pages. So, you load them, but there are no links on them, and there is no parent page. Many people would not check out the url and...
3
10602
by: nicver | last post by:
I am working on updating a Web site with a frameset. A page opens a pop-up window in which the user uploads pictures. Once the upload is done, I would like to refresh the content of the frame which opened the pop-up but so far have failed. Here is my code: <% (ASP code which saves the photo in a database) %>
2
23504
by: Raj | last post by:
Hi All, I have a problem with trying to refresh the parent window from child window in order to update data in the parent window. The sequence of events are 1) I click a button in the parent window to open a child window thru javascript window.open 2) I have some functionality in the child window that changes the data
2
23503
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an iframe on my page whose html has the refresh meta as follows : <meta http-equiv="refresh" content="10"> The iframe is effectivelyh refreshed every 10 seconds without having the
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
4232
by: Lee | last post by:
Hi, I have a page with a few iframes. How would I write a function to refresh another iframe from one iframe? Something like this? function refreshOtherIframe(){ parent.document.getElementById('otherIframe').refresh(); }
4
3976
by: Buddha | last post by:
Hello, I posted this on two forums, without too much help .. and I am kinda stuck in this. I need to refresh the parent page from the second child window which is opened by the first child and the first child window closes after opening the second child. This is the second time I am typing the post, I lost all content because the site complaine I was using the lesser than symbol.
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,...
0
8979
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
7895
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...
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
4440
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...
1
3138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.