473,811 Members | 3,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trigger postback from popup window



Hi

I want to trigger a postback in my parent page from my popup window
which i opened with javascript. How to go about this?

ch Beffer

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #1
10 2220
Hi,

maybe my blog post helps you

ASP.NET: How to create a postback on a main page from a popup window
http://blogs.aspadvice.com/joteke/ar...6/15/4063.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Nov 19 '05 #2
thanks but when i run it i get:

Compiler Error Message: CS0103: The name 'btnPostBack' does not exist in the
class or namespace 'ASP.WebForm1_a spx'

ch B.
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:e7******** ******@tk2msftn gp13.phx.gbl...
Hi,

maybe my blog post helps you

ASP.NET: How to create a postback on a main page from a popup window
http://blogs.aspadvice.com/joteke/ar...6/15/4063.aspx

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #3
It's tested.

See the second line in my example, you do have a server-side Button which
has ID btnPostBack? Note that you can rename them freely as long IDs etc are
reflected where they are used.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
Nov 19 '05 #4
i am trying:
Response.Write( "<script>javasc ript:__doPostBa ck('','');</script>");

to force a postback on the parent page but it does not work??

"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
It's tested.

See the second line in my example, you do have a server-side Button which
has ID btnPostBack? Note that you can rename them freely as long IDs etc are reflected where they are used.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #5
i get an error after clicking the popupbutton :
'Object expected' line 9 char 2
that is on the line with :
<%=Page.GetPost BackEventRefere nce(btnPostBack )%>

ch B
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:es******** ******@TK2MSFTN GP09.phx.gbl...
It's tested.

See the second line in my example, you do have a server-side Button which
has ID btnPostBack? Note that you can rename them freely as long IDs etc are reflected where they are used.
--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #6
Follow my example exactly as it is from line to line, so that you can see
how it works. After that, apply it for your scenario.

You cannot use Response.Write to write the __doPostBack call.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #7
And FYI: I uploaded the sample pages so that they can be downloaded:

http://www.elisanet.fi/teemu.keiski/popupsample.zip

Just place them on your app directory and test it out.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #8
thanks very much!
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:uW******** *****@tk2msftng p13.phx.gbl...
And FYI: I uploaded the sample pages so that they can be downloaded:

http://www.elisanet.fi/teemu.keiski/popupsample.zip

Just place them on your app directory and test it out.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #9
FYI what also works instead of :

<%=Page.GetPost BackEventRefere nce(btnPostBack )%>

is:

__doPostBack('b tnPostBack', '');

ch B.
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:#7******** *****@TK2MSFTNG P10.phx.gbl...
Follow my example exactly as it is from line to line, so that you can see
how it works. After that, apply it for your scenario.

You cannot use Response.Write to write the __doPostBack call.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke

Nov 19 '05 #10

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

Similar topics

5
2519
by: Jay | last post by:
I have a situation where the user clicks on a button in a DataGrid to launch a popup window via javascript. In the popup window the user does some things that result in changes to the underlying database the DataGrid is using as a data source. When the popup window is closed I want to refresh the main window -- i.e., cause a postback to happen. Is this possible?
3
4552
by: EMW | last post by:
Hi, Is it possible with VB.NET and Javascript to popup a window, after a buttonclick, in which the user writes some text in a textbox and then when that window is closed with a button, the text is posted back to the aspx program? If it is possible, please let me know some articles about this? thanks,
1
11593
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
7
2606
by: Drew Berkemeyer | last post by:
Hello, We have an application that we have written using ASP.NET. On one of our pages we open a popup window using javascript. The popup window has a save and a cancel button. Both of them are server-side controls and do a postback. While processing on the server we add javascript to the page load (i.e. onload=window.opener.focus(); window.close()). However, the window.close() command does not close the IE popup window. This happens...
2
1523
by: Lars Netzel | last post by:
I open a popup from an aspx page and when done working in the popup i I need to update the aspx page in the background. I know how to get to the page in the background thru JavaScript (window.opener.. ) but how do I trigger a postback that will keep the viewstate of that page? best regards/ Lars Netzel
2
20649
by: Rob Roberts | last post by:
Is there any way to prevent a ButtonField in a GridView from doing a postback when clicked? I want to use my own onclick handler to call window.open('SomePage.aspx') to display a page in a new browser window when the button is clicked. I tried doing this in the RowCommand postback event by doing this in the event handler: Response.Write("<script>window.open('SomePage.aspx');</script>");
2
3899
by: Sally B. | last post by:
Hi, I have a main page that opens a pop up window when the user clicks a link. The pop up window is a menu and when the user clicks the item, it populates a form input element on the 'parent' window. My question is: this new populated form element is the value that I use to change a style. onchange does not watch this form element because of getelementbyid, so
4
8207
by: Frank | last post by:
Hello everyone, I have a problem that the window.opener variable is lost once my popup page has a postback. On multiple pages they address this problem but I cannot find a correct answer. This is my situation: I have a main page which shows invoices. When a user clicks on the invoices they get a popup where they can alter the invoice which uses
4
2811
by: Peter | last post by:
ASP.NET 3.5 I have a web page and this web page has a DataList, when user hovers the mouse over a picture in the datalist a popup appers, this popup is a User Control and it has a cancel button. After the user clicks on the cancel button I want the DataList to refresh its self. How can I do that - how can I tell the DataList or the parent web page to refresh it's self from the Popup / User Control?
0
9731
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
10651
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
10405
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
9208
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
7671
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
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4342
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
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
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.