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?
From a user-interface perspective the popup window works
very nice. I know that I could perform the same funtion
in the main window but that would be messy.
Jay 5 2505
If you get the window.opener object (also a window) you can use the
window.location .reload before you close the popup window.
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Shell/UI
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Jay" <an*******@disc ussions.microso ft.com> wrote in message
news:01******** *************** *****@phx.gbl.. . 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?
From a user-interface perspective the popup window works very nice. I know that I could perform the same funtion in the main window but that would be messy.
Jay
If the grid on main window is just populated when the page loads, you just
call opener.location .reload() (javascript call) on pop-up and cause it to
reload the main page.
However, if it needs more work, i.e a postback like some button would have
caused it (say Button) and an event to handle, you could have a hidden
button control on main window:
<asp:Button ID="btnHidden" runat="server" />
and then an associated javascript function for it (also on main window)
function myPostBack()
{
<%=Page.GetPost BackEventRefere nce(btnHidden,' ')%>
}
This causes a postback event to be raised in behalf of the Button, when
myPostBAck is called. You could then call this on the pop-up window by:
opener.myPostBa ck();
and it causes the main window to be posted as if btnHidden would have been
clicked. So to handle this click you need to handle btnHidden's Click event.
of course, if you already have a Button (or other control) that does this,
you could cause the postback on behalf of it as well.
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Jay" <an*******@disc ussions.microso ft.com> wrote in message
news:01******** *************** *****@phx.gbl.. . 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?
From a user-interface perspective the popup window works very nice. I know that I could perform the same funtion in the main window but that would be messy.
Jay
Note that for the Button to be hidden, it should have Visible="False" as
well. :-)
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. .. If the grid on main window is just populated when the page loads, you just call opener.location .reload() (javascript call) on pop-up and cause it to reload the main page.
However, if it needs more work, i.e a postback like some button would have caused it (say Button) and an event to handle, you could have a hidden button control on main window:
<asp:Button ID="btnHidden" runat="server" />
and then an associated javascript function for it (also on main window)
function myPostBack() { <%=Page.GetPost BackEventRefere nce(btnHidden,' ')%> }
This causes a postback event to be raised in behalf of the Button, when myPostBAck is called. You could then call this on the pop-up window by:
opener.myPostBa ck();
and it causes the main window to be posted as if btnHidden would have been clicked. So to handle this click you need to handle btnHidden's Click
event. of course, if you already have a Button (or other control) that does this, you could cause the postback on behalf of it as well.
-- Teemu Keiski MCP, Microsoft MVP (ASP.NET), AspInsiders member ASP.NET Forum Moderator, AspAlliance Columnist
"Jay" <an*******@disc ussions.microso ft.com> wrote in message news:01******** *************** *****@phx.gbl.. . 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?
From a user-interface perspective the popup window works very nice. I know that I could perform the same funtion in the main window but that would be messy.
Jay
You may also just be able to just call the javascript postback that asp.net
creates using
__doPostBack("y ourobjectname", "") within your own javascript.
"Jay" <an*******@disc ussions.microso ft.com> wrote in message
news:01******** *************** *****@phx.gbl.. . 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?
From a user-interface perspective the popup window works very nice. I know that I could perform the same funtion in the main window but that would be messy.
Jay
Definately, but only when there is at least one control at the Page that
requires this JavaScript to exist. A call to Page.GetPostBac kEventReference
ensures that __doPostBack declaration is outputted (that's what the control
needing this declaration calls)
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"vMike" <Mi************ @nospam.gewarre n.com.delete> wrote in message
news:bp******** **@ngspool-d02.news.aol.co m... You may also just be able to just call the javascript postback that
asp.net creates using __doPostBack("y ourobjectname", "") within your own javascript.
"Jay" <an*******@disc ussions.microso ft.com> wrote in message news:01******** *************** *****@phx.gbl.. . 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?
From a user-interface perspective the popup window works very nice. I know that I could perform the same funtion in the main window but that would be messy.
Jay
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ashish |
last post by:
Hi All,
I have a server runnable textbox control. I also have a server side button
object but I hook up javascript to it to show a modal dialog. Upon return it
places the value in the textbox (client side script). The problem is that
after it places the value, postback occurs and value is lost. I have tried
overriding SaveViewState and LoadViewState but it doesnt help (for some
super cool reason load is called first after postback rather...
|
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,
|
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.
...
|
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...
|
by: John Walker |
last post by:
Hi,
I have a datagrid with a radiobutton template column, with AutoPostBack set
to TRUE. When the user clicks on a radiobutton the application will
PostBack, and in the PostBack there will be certain logic performed, and the
dataview will be re-binded to the datagrid. There turns out to be about 2-5
seconds delay between the time the user clicks the radiobutton and when the
page is completely re-loaded. During this time the user may try...
| |
by: SkeanDu |
last post by:
Ok, here is my problem.
I have an aspx page that displays a databound datagrid and in one of
the datagrid column headers I have an image that when clicked opens up
a modal web dialog (another aspx page).
>From this dialog I want the users to be able to select a filter item
from a databound combobox and click on the apply button on the web
dialog that will then disappear and the filtered data will be displayed
on my datagrid.
|
by: Shawn |
last post by:
Any ideas how I can have a button click on one open page force a postback on
a different page.
|
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>");
|
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
|
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...
|
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,...
| |
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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...
|
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();...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |