How to access asp.net controls from DNN skin code behind The Next CEO of Stack OverflowHow do you create a dropdownlist from an enum in ASP.NET MVC?Placing code behind for a DNN pageASP.NET making a user controlled template with WebControls in themHow to access HTML control in C# code behind without “runat=server”?How to Export Gridview Data in Pdf in DotNetNuke(DNN)?How to find a client side element in an update panel from code behind?Writing this HTML Control in ASP.NETHow to do Code Behind for a User Control FileHow to set Chart control width into percentageUnable to create a User Control Module for ASP.NET controls in DNN 8

Find the majority element, which appears more than half the time

Strange use of "whether ... than ..." in official text

It it possible to avoid kiwi.com's automatic online check-in and instead do it manually by yourself?

How do I keep Mac Emacs from trapping M-`?

What happens if you break a law in another country outside of that country?

What steps are necessary to read a Modern SSD in Medieval Europe?

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

subequations: How to continue numbering within subequation?

How can I separate the number from the unit in argument?

How to pronounce fünf in 45

How does a dynamic QR code work?

Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?

Is it correct to say moon starry nights?

Does Germany produce more waste than the US?

Planeswalker Ability and Death Timing

Would a grinding machine be a simple and workable propulsion system for an interplanetary spacecraft?

Can a PhD from a non-TU9 German university become a professor in a TU9 university?

Avoiding the "not like other girls" trope?

A hang glider, sudden unexpected lift to 25,000 feet altitude, what could do this?

Physiological effects of huge anime eyes

Finitely generated matrix groups whose eigenvalues are all algebraic

Could a dragon use its wings to swim?

Is a linearly independent set whose span is dense a Schauder basis?

Man transported from Alternate World into ours by a Neutrino Detector



How to access asp.net controls from DNN skin code behind



The Next CEO of Stack OverflowHow do you create a dropdownlist from an enum in ASP.NET MVC?Placing code behind for a DNN pageASP.NET making a user controlled template with WebControls in themHow to access HTML control in C# code behind without “runat=server”?How to Export Gridview Data in Pdf in DotNetNuke(DNN)?How to find a client side element in an update panel from code behind?Writing this HTML Control in ASP.NETHow to do Code Behind for a User Control FileHow to set Chart control width into percentageUnable to create a User Control Module for ASP.NET controls in DNN 8










0















I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET control on my home.ascx file, I'm unable to reference it in the code behind.



I know that on normal web projects, the aspx.designer.cs file controls all that but I don't know how to generate one for a .ascx file or if that's even how it should work in a DNN skin.



How do I reference an ASP.NET control from the code behind in a DNN skin template?



Here's the control I'm trying to access:



<asp:HyperLink ID="hlAccountSettings" runat="server">My Account</asp:HyperLink>


And the code behind:



namespace Company.Modules.CompanySkin2019

public partial class Home : SkinBase

protected override void OnLoad(EventArgs e)

base.OnLoad(e);

UserInfo currUserInfo = UserController.Instance.GetCurrentUserInfo();
hlAccountSettings.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Profile", "userId=" + currUserInfo.UserID, "pageno=1");
// ^ ERROR: The name 'hlAccountSettings' does not exist in the current context












share|improve this question


























    0















    I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET control on my home.ascx file, I'm unable to reference it in the code behind.



    I know that on normal web projects, the aspx.designer.cs file controls all that but I don't know how to generate one for a .ascx file or if that's even how it should work in a DNN skin.



    How do I reference an ASP.NET control from the code behind in a DNN skin template?



    Here's the control I'm trying to access:



    <asp:HyperLink ID="hlAccountSettings" runat="server">My Account</asp:HyperLink>


    And the code behind:



    namespace Company.Modules.CompanySkin2019

    public partial class Home : SkinBase

    protected override void OnLoad(EventArgs e)

    base.OnLoad(e);

    UserInfo currUserInfo = UserController.Instance.GetCurrentUserInfo();
    hlAccountSettings.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Profile", "userId=" + currUserInfo.UserID, "pageno=1");
    // ^ ERROR: The name 'hlAccountSettings' does not exist in the current context












    share|improve this question
























      0












      0








      0








      I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET control on my home.ascx file, I'm unable to reference it in the code behind.



      I know that on normal web projects, the aspx.designer.cs file controls all that but I don't know how to generate one for a .ascx file or if that's even how it should work in a DNN skin.



      How do I reference an ASP.NET control from the code behind in a DNN skin template?



      Here's the control I'm trying to access:



      <asp:HyperLink ID="hlAccountSettings" runat="server">My Account</asp:HyperLink>


      And the code behind:



      namespace Company.Modules.CompanySkin2019

      public partial class Home : SkinBase

      protected override void OnLoad(EventArgs e)

      base.OnLoad(e);

      UserInfo currUserInfo = UserController.Instance.GetCurrentUserInfo();
      hlAccountSettings.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Profile", "userId=" + currUserInfo.UserID, "pageno=1");
      // ^ ERROR: The name 'hlAccountSettings' does not exist in the current context












      share|improve this question














      I'm working on a DNN skin using Christoc's DNN templates and when I create a normal ASP.NET control on my home.ascx file, I'm unable to reference it in the code behind.



      I know that on normal web projects, the aspx.designer.cs file controls all that but I don't know how to generate one for a .ascx file or if that's even how it should work in a DNN skin.



      How do I reference an ASP.NET control from the code behind in a DNN skin template?



      Here's the control I'm trying to access:



      <asp:HyperLink ID="hlAccountSettings" runat="server">My Account</asp:HyperLink>


      And the code behind:



      namespace Company.Modules.CompanySkin2019

      public partial class Home : SkinBase

      protected override void OnLoad(EventArgs e)

      base.OnLoad(e);

      UserInfo currUserInfo = UserController.Instance.GetCurrentUserInfo();
      hlAccountSettings.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Profile", "userId=" + currUserInfo.UserID, "pageno=1");
      // ^ ERROR: The name 'hlAccountSettings' does not exist in the current context









      c# asp.net dotnetnuke






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 21 at 19:28









      TheIronCheekTheIronCheek

      4691520




      4691520






















          1 Answer
          1






          active

          oldest

          votes


















          0














          In our case, we create a user control like:



          <div class="checkbox">
          <label>
          <asp:CheckBox ID="changeForAll" runat="server" OnCheckedChanged="changeForAll_OnCheckedChanged" Text="Apply changes for all devices" Checked="True" AutoPostBack="true" />
          </label>
          </div>


          And the code behind:



           public partial class ChangeForAllCheckbox : System.Web.UI.UserControl

          protected void Page_Load(object sender, EventArgs e)

          if (!Page.IsPostBack)

          changeForAll.Checked = ...;



          protected void changeForAll_OnCheckedChanged(object sender, EventArgs e)

          [...]







          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55287990%2fhow-to-access-asp-net-controls-from-dnn-skin-code-behind%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            In our case, we create a user control like:



            <div class="checkbox">
            <label>
            <asp:CheckBox ID="changeForAll" runat="server" OnCheckedChanged="changeForAll_OnCheckedChanged" Text="Apply changes for all devices" Checked="True" AutoPostBack="true" />
            </label>
            </div>


            And the code behind:



             public partial class ChangeForAllCheckbox : System.Web.UI.UserControl

            protected void Page_Load(object sender, EventArgs e)

            if (!Page.IsPostBack)

            changeForAll.Checked = ...;



            protected void changeForAll_OnCheckedChanged(object sender, EventArgs e)

            [...]







            share|improve this answer



























              0














              In our case, we create a user control like:



              <div class="checkbox">
              <label>
              <asp:CheckBox ID="changeForAll" runat="server" OnCheckedChanged="changeForAll_OnCheckedChanged" Text="Apply changes for all devices" Checked="True" AutoPostBack="true" />
              </label>
              </div>


              And the code behind:



               public partial class ChangeForAllCheckbox : System.Web.UI.UserControl

              protected void Page_Load(object sender, EventArgs e)

              if (!Page.IsPostBack)

              changeForAll.Checked = ...;



              protected void changeForAll_OnCheckedChanged(object sender, EventArgs e)

              [...]







              share|improve this answer

























                0












                0








                0







                In our case, we create a user control like:



                <div class="checkbox">
                <label>
                <asp:CheckBox ID="changeForAll" runat="server" OnCheckedChanged="changeForAll_OnCheckedChanged" Text="Apply changes for all devices" Checked="True" AutoPostBack="true" />
                </label>
                </div>


                And the code behind:



                 public partial class ChangeForAllCheckbox : System.Web.UI.UserControl

                protected void Page_Load(object sender, EventArgs e)

                if (!Page.IsPostBack)

                changeForAll.Checked = ...;



                protected void changeForAll_OnCheckedChanged(object sender, EventArgs e)

                [...]







                share|improve this answer













                In our case, we create a user control like:



                <div class="checkbox">
                <label>
                <asp:CheckBox ID="changeForAll" runat="server" OnCheckedChanged="changeForAll_OnCheckedChanged" Text="Apply changes for all devices" Checked="True" AutoPostBack="true" />
                </label>
                </div>


                And the code behind:



                 public partial class ChangeForAllCheckbox : System.Web.UI.UserControl

                protected void Page_Load(object sender, EventArgs e)

                if (!Page.IsPostBack)

                changeForAll.Checked = ...;



                protected void changeForAll_OnCheckedChanged(object sender, EventArgs e)

                [...]








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 22 at 13:30









                Erick Langford XenesErick Langford Xenes

                93111023




                93111023





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55287990%2fhow-to-access-asp-net-controls-from-dnn-skin-code-behind%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해