Copied to clipboard

Flag this post as spam?

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


  • Axel 68 posts 96 karma points
    May 15, 2014 @ 08:54
    Axel
    0

    Codehind link to Contentpage

    Hi,how looks the code that i can build in a link to a content page.

    i use umbraco 7 and want in a usercontrol (from codebehind like response.redirect) a link to a content page.

    axel

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 15, 2014 @ 09:44
    Jeavon Leopold
    0

    In MVC there are SurfaceControllers which are similar to the .ascx.cs of a usercontrol and we have RenderMvcControllers which are similar to the .master.cs of a masterpage

    If you are using WebForms and usercontrols there is nothing special you need to do, although you can choose to render usercontrols using the MacroEngine if you like.

    Jeavon

  • Axel 68 posts 96 karma points
    May 15, 2014 @ 10:17
    Axel
    0

    Oh sorry i mean Codebehind !!
    I use Webforms.

    Hi Jeavon, thanks for your reply. I mean what i write as code to link to a content page . whats the excact code for this (node id? or something else)
    Axel

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 15, 2014 @ 10:51
    Jeavon Leopold
    0

    Ok, so codebehind a master page and you want to find out the current content item?

  • Axel 68 posts 96 karma points
    May 15, 2014 @ 12:29
    Axel
    0

    HI jeavon, no . i have a customcontrol that a place via a macro on a master page.

    and in this customcontrol i want have a link (like response.redirect) to a content page of umbraco (in my website)

    i must now how to link to content pages of umbraco (find out Nodeid and more?)

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    May 15, 2014 @ 12:42
    Jeavon Leopold
    0

    Hi Axel,

    You should have your usercontrol implement Umbraco.Web.UI.Controls.UmbracoControl, then you have access to Umbraco.TypedContent(1234) etc.

    Documentation here

    Jeavon

  • Axel 68 posts 96 karma points
    May 15, 2014 @ 20:44
    Axel
    0

    Thanks , that was i am looking for.

    Axel

Please Sign in or register to post replies

Write your reply to:

Draft