#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    egypt
    Posts
    16
    Rep Power
    0

    Question refresh window from another one


    how can i refresh window from another by just clicking button


    thank u all for help
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12

    JavaScript


    I don't think this is possible using ASP...
    you should probably be looking for Client side Javascript to do something like that.

    I hope this is of any help
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    138
    Rep Power
    12
    Yes you can refresh another window using client side scripting ie. Javascript or vbscript

    All you have to do is name you windows. You have to name the windows when you open them in script. Then you reference one window from another.

    The following show that you can only refresh the page from the page that opens the window, or you have to ask the window that opened the window to change via a function.
    I guess this is for security reasons.

    The following code opens two windows and one child changes the href of the other with the help from the parent. The parent olso changes the href of one of its children.
    This can of course be used to refresh asp pages as well.

    parent.html
    Code:
    <html>
    <head>
      <title></title>
    <script language="javascript">
    var win2;
    
    function change(href){
      win2.location.href = href;
    }
    </script>
    </head>
    <body>
    <form>
    <input type="hidden" value="8" name="y">
      <input type="button" value="open1" onclick="win1=open('one.htm','title1','width=200,height=200');">
      <input type="button" value="open2" onclick="win2=open('http://www.yahoo.com','title2','width=200,height=200')">
      <input type="button" value="change1" onclick="win1.document.location.href='http://www.google.com'">
    </form>
    </body>
    </html>
    one.htm
    Code:
    <html>
    <head>
      <title></title>
    </head>
    <body>
    <form>
      <input type="button" value="change2" onclick="opener.change('http://www.google.com');">
    </form>
    </body>
    </html>
    Here is an alternative version of one.htm
    I don't exactly know how you want to activate the refresh. Do you consider an <a> tag a button?
    Code:
    <html>
    <head>
      <title></title>
    </head>
    <body>
    <form target="title2" action="http://www.tucows.com">
      <input type="button" value="change2" onclick="opener.change('http://www.google.com');">
      <input type="submit" value="change2b">
    </form>
    <a href="http://www.tucows.com" target="title2">click</a>
    </body>
    </html>

    Comments on this post

    • mauled agrees : good example
    Last edited by ngibsonau; February 27th, 2003 at 12:20 AM.
    --

    ngibsonau

IMN logo majestic logo threadwatch logo seochat tools logo