Tech Off Thread

7 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

redirect

Back to Forum: Tech Off
  • User profile image
    Rake

    ok well i managed to change the info the in default.aspx file in the files folder to this

    <script runat="server">

        // Insert page code here
        //
       
        void Page_Load(object sender, EventArgs e) { Response.Redirect("site address");
       
        }

    </script>

    but i want it so open in a sperate browser page. How can i do that?

  • User profile image
    Matthew van Eerde

    You can't redirect to a new browser window.

    You can do this:

    <a target="_blank" href="...">...</a>

    You can do this:

    <form target="_blank" ...>...</form>

    You can do this:

    <script ...>window.open(...)</script>

    but HTTP has no concept of windows.

  • User profile image
    Rake

    ok so the page looks like this

    <script runat="server">

        // Insert page code here
        //
       
        void Page_Load(object sender, EventArgs e) { Response.Redirect("siteaddress");
       
        }

    </script>
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

    can do a example for me?

    I don't understand the placement..

  • User profile image
    Matthew van Eerde

    A page should not open itself in a new window.  The new-window-ness of the page is under the control of the linking page, not the linked-to page.

  • User profile image
    Rake

    i understand that but how would the code look?

  • User profile image
    Matthew van Eerde

    That depends.  How does the user get to this page in the first place?  Can you show me the code for the page that directs them here?

  • User profile image
    figuerres

    Rake wrote:
    


    can do a example for me?

    I don't understand the placement..




    ok so the page looks like this

    <script runat="server">

        // Insert page code here
        //
       
        void Page_Load(object sender, EventArgs e) {
       //
       //Response.Redirect("siteaddress");
       //
        }

    </script>
    <html>
    <head>
    </head>
    <body>
        <a target="_blank" href="...">Open New Window</a>
    </body>
    </html>


    one example....

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.