 |
| ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 11th, 2007, 05:07 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Refreshing a page based on action in pop-up
Hi,
I have a .NET page from where i pop-up another .NET page. Now based on action on this page I need to refresh the parent page and close it. How can this be done. The code that i'm using:
Code:
popup.aspx
<h3>Add to My Reports:</h3>
<div id="theList">
<asp:ListBox ID="AllReports" runat="server" SelectionMode="Multiple" BorderWidth="0"
Width="538px" Height="600px" />
</div>
<div style="float: right; margin: 12px 12px 0 0;">
<asp:ImageButton ID= "BtnAddReport" OnClick = "BtnAddReport_Click"
runat= "server" ImageUrl="imgs/addv4-blue.gif" height="32" width="105"
AlternateText = "" />
</div>
-----------------
popup.aspx.cs
protected void BtnAddReport_Click(object sender, EventArgs e)
{
MyReportTableAdapter myReportAdapter = new MyReportTableAdapter();
AvailableReportsTableAdapter reportAdapter = new AvailableReportsTableAdapter();
Int32 reportID;
foreach (ListItem item in AllReports.Items)
{
if (item.Selected)
{
reportID = Int32.Parse(item.Value);
myReportAdapter.AddReports(3, reportID);
}
}
}
------------------------------------------------------------------------------------------------------------
Adventure, Play, Alive, Fast, Race, Addict, React, Attack, Heat, Aggression, Blast, Ahead, Escape, Challenge, Anarchy, Game, Real, Damage, Insane, Acclerate,Passion, Fear, Dominate, Crazy, Awesome, Sweat, Habit, Avenge, Balls, Imagine, Viril, Chaos, Amuse, Heavy, Panic, @#!%, Fanatic
__________________
------------------------------------------------------------------------------------------------------------
<b><i>Adventure, Play, Alive, Fast, Race, Addict, React, Attack, Heat, Aggression, Blast, Ahead, Escape, Challenge, Anarchy, Game, Real, Damage, Insane, Acclerate,Passion, Fear, Dominate, Crazy, Awesome, Sweat, Habit, Avenge, Balls, Imagine, Viril, Chaos, Amuse, Heavy, Panic, @#!%, Fanatic </i></b>
|
|

January 11th, 2007, 09:38 AM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
On the page you popup you can do something like this:
in the <body> of your popup place: onunload="window.opener.location.href="path/to/file";"
this will cause the parent page to refresh but if you want to do this all in one shot through code, build a string with the above value and add window.close(); then write it back to the client.
That will cause the popup to close and the parent page to refresh.
-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
^^Thats my signature
|
|

January 13th, 2007, 08:34 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanx .. it did the trick ..
------------------------------------------------------------------------------------------------------------
Adventure, Play, Alive, Fast, Race, Addict, React, Attack, Heat, Aggression, Blast, Ahead, Escape, Challenge, Anarchy, Game, Real, Damage, Insane, Acclerate,Passion, Fear, Dominate, Crazy, Awesome, Sweat, Habit, Avenge, Balls, Imagine, Viril, Chaos, Amuse, Heavy, Panic, @#!%, Fanatic
|
|

January 15th, 2007, 02:48 AM
|
|
Authorized User
|
|
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi dparsons,
The soln tht u suggested worked but if more than 1 item in the ListBox is selected then the parent page only shown 1 updated field although an F5 shows all the items, can u suggest something ..
------------------------------------------------------------------------------------------------------------
Adventure, Play, Alive, Fast, Race, Addict, React, Attack, Heat, Aggression, Blast, Ahead, Escape, Challenge, Anarchy, Game, Real, Damage, Insane, Acclerate,Passion, Fear, Dominate, Crazy, Awesome, Sweat, Habit, Avenge, Balls, Imagine, Viril, Chaos, Amuse, Heavy, Panic, @#!%, Fanatic
|
|

January 15th, 2007, 04:21 PM
|
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
I dont understand what you mean please explain a little further.
-----------------------------------------------------------
I will only tell you how to do it, not do it for you.------------
Unless, of course, you want to hire me to do work for you.---
^^Thats my signature--------------------------------------
-----------------------------------------------------------
http://www.catb.org/~esr/faqs/smart-questions.html -------
^^Took that from planoie's profile--------------------------
-----------------------------------------------------------
|
|
 |