Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
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
 
Old January 11th, 2007, 05:07 AM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 = "" />&nbsp;
            </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>
 
Old January 11th, 2007, 09:38 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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
 
Old January 13th, 2007, 08:34 AM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old January 15th, 2007, 02:48 AM
Authorized User
 
Join Date: Mar 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old January 15th, 2007, 04:21 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

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--------------------------
-----------------------------------------------------------





Similar Threads
Thread Thread Starter Forum Replies Last Post
access C#.Net page as action of calssic ASP page mansharma_s ASP.NET 1.x and 2.0 Application Design 6 January 7th, 2008 10:58 AM
Action Script based Charts (bar, pie, etc). robprell Flash (all versions) 0 March 30th, 2007 08:17 PM
based upon parameter perform action warsha_14 Struts 4 August 5th, 2006 04:51 AM
Refreshing "main" page from "pop up" window acedanger Javascript How-To 2 May 12th, 2006 08:44 AM
refreshing XML withour refreshing the page sasidhar79 XML 1 January 12th, 2005 05:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.