Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - External Links page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

External Links page

 Post Reply Post Reply Page  <1234>
Author
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2004 at 12:15pm
Works except the link comes out as: http://test.huwnet.org.uk/http%3a%2f%2fwww.microsoft.com
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 23 September 2004 at 12:20pm
scrap the URL encode, change

hl1.NavigateUrl = Server.URLEncode(Request.Querystring("URL"))

to

hl1.NavigateUrl = Request.Querystring("URL")
Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2004 at 1:49pm
Thanks that worked well.

Is there any way the script could be changed slightly so that instead of being a hyperlink it could be a page include

e.g http://www.huwnet.org.uk/redirect.aspx?page=article1.html

code=

include=page


Edited by huwnet
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2004 at 3:09pm
I don't know why you would want to do that but this should work (presuming the file is on the same server as the web server)


<%@ Page Language="VB" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
    Dim FilePath As String = Server.MapPath(Request.QueryString("page"))

    If Path.GetExtension(FilePath).ToLower = ".html" or _
    Path.GetExtension(FilePath).ToLower = ".htm" Then

    Dim sr As StreamReader

    Try
    sr = New StreamReader(FilePath)
    Catch ex As Exception
    litArticle.Text = "<b>Error:</b> " & ex.Message
    Exit Sub
    End Try

    litArticle.Text = sr.ReadToEnd()

    sr.Close()
    End If
    End Sub

</script>
<html>
<head>
</head>
<body>
    <form runat="server">
        <h1>View Article
        </h1>
        <h1><font size="3">Here is the article you requested:</font>
        </h1>
        <p>
         &nbs p;  <asp:Literal id="litArticle" runat="server"></asp:Literal>
        </p>
    </form>
</body>
</html>

Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2004 at 8:48am
Using that code  i get:

View Article

Here is the article you requested:

&nbs p;


Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2004 at 10:26am
You have to add the ?page=artcle.html to the end of the URL
Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2004 at 12:26pm
I did. See http://www.huwnet.org.uk/redirect.aspx?page=top.asp
Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 26 September 2004 at 12:28pm
UPDATE: With html http://www.huwnet.org.uk/redirect.aspx?page=donate.html

It works but you still get &nbs p;
With asp it doesn't work at all.
Back to Top
 Post Reply Post Reply Page  <1234>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.