Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig Cronin 303 posts 502 karma points
    Sep 05, 2010 @ 00:13
    Craig Cronin
    0

    Redirect on Page Load

    I'm trying to create a redirect page that will show in the navigation but allow users to enter a text field in edit mode and redirect on page load.

    <asp:Content ID="HeadContent" ContentPlaceHolderID="Head" Runat="Server">
        <script runat="server">
     void Page_Load(Object s, EventArgs e)
     {
      Response.Redirect("<umbraco:Item field="redirectUrl" runat="server"></umbraco:Item>");
     }
        </script>
    </asp:Content>

    This doesn't quite work, any help would be appreciated.

    Craig

  • Dirk De Grave 4537 posts 6006 karma points MVP 3x admin c-trib
    Sep 05, 2010 @ 10:13
    Dirk De Grave
    0

    Craig,

    I'm not sure whether I understand your question completely, but are you aware of the umbracoRedirect property (of type content picker). If used on a page, the visitor will be redirected to page specified by that property.

    For example: let's assume you've got the following structure:

    - Content

    -- Blog

    --- Blog post 1

    --- Blog post 2

    If you want visitors of your site to land on your first blog post, even when they've requested the /blog(.aspx) page, you could add a umbracoRedirect property, set the property on the Blog document to 'Blog post 1', and now whenever a visitor requests the 'Blog' page, he'll be redirected to 'Blog post 1'. 

     

    Is this is what you're after. If not, please elaborate and provide us with a short example of what you're trying to achieve.

     

    Cheers,

    /Dirk

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies