Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2007, 05:07 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
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>
  #2 (permalink)  
Old January 11th, 2007, 09:38 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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
  #3 (permalink)  
Old January 13th, 2007, 08:34 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
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
  #4 (permalink)  
Old January 15th, 2007, 02:48 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
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
  #5 (permalink)  
Old January 15th, 2007, 04:21 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
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--------------------------
-----------------------------------------------------------
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:30 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.