Copied to clipboard

Flag this post as spam?

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


  • Christoffer Andersen 23 posts 53 karma points
    Jan 19, 2010 @ 14:15
    Christoffer Andersen
    0

    Rendering UmbracoPanel in codebehind

    Greetings

    I m working my way through the tutorials at http://umbraco.org/documentation/videos/for-developers and have reached the creating edit pages (http://umbraco.org/documentation/videos/for-developers/custom-sections,trees-and-pages/creating-edit-pages). The guides have so far worked great for me, but using visual studio 2008, when I add my panels and textboxes etc. in the aspx code, I can't acces them in my codebehind, as as example I have quite simply made this:

     

    <%@ Page Language="C#" MasterPageFile="../masterpages/umbracoPage.Master" AutoEventWireup="true" CodeBehind="editCorporateCompliance.aspx.cs"%>
    <%@ Register Namespace="umbraco.uicontrols" Assembly="controls" TagPrefix="umb" %>


    <asp:Content ID="Content" ContentPlaceHolderID="body" runat="server">

        <umb:UmbracoPanel ID="Panel1" runat="server" hasMenu="true" Text="Edit Corporate Compliance">
       
           
       
        </umb:UmbracoPanel>

    </asp:Content>

     

    However when accessing the codebehind file and trying to access Panel1 it replies with the error that the name does not exist in the current context.

    Does anyone have any idea why the panel can't be accessed through the codebehind?

     

    With kind regards

     

    Christoffer Andersen

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 19, 2010 @ 14:31
    Lee Kelleher
    0

    Do you have the "umbraco.uicontrols" assembly referenced in your VS.NET project/solution? (not just registered in the ASPX)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 19, 2010 @ 14:32
    Dirk De Grave
    0

    Have you tried switching to design view? May need to do so to update the designer code file and to reference the control in the codebehind...

     

    Hope this helps.

    Regards,

    /Dirk

  • Christoffer Andersen 23 posts 53 karma points
    Jan 19, 2010 @ 16:02
    Christoffer Andersen
    0

    greetings again

     

    @Lee, yes I have the reference to the dll in my references directory in VS

    @Dirk thx for the hint, was an inherit referering to my class name witch I have forgotten :)

     

    Again thank you for the help peeps

Please Sign in or register to post replies

Write your reply to:

Draft