1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Code behind option in page properties

Code behind option in page properties

5 posts, 0 answered
  1. John
    John avatar
    97 posts
    Registered:
    11 Jan 2011
    27 Jun 2011
    Link to this post

    Hi

    What is the 'Code behind type' option for in the page properties? Is there an example of how to use this option?

    Thanks

    Regards

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    27 Jun 2011
    Link to this post
    Hi John,

    Create a class which inherits from  System.Web.UI.Page  and use its type as a code behind of your page. It is similar like putting the code in the master page.

    namespace Telerik.Sitefinity.Samples1
    {
        public class PageBaseCustom : System.Web.UI.Page
        {

            protected override void OnLoad(EventArgs e)
            {
                base.OnLoad(e);
                Label lbl = new Label();
                lbl.Text = "hello";
                Controls.Add(lbl);

            }
        }
    }


    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Ishtiyaq
    Ishtiyaq avatar
    11 posts
    Registered:
    17 Sep 2011
    04 Oct 2011
    Link to this post
    Can you please, Elobrate more and how can redirect from page to another by using these.

    Ishtiyaq Mohammed
  4. Ishtiyaq
    Ishtiyaq avatar
    11 posts
    Registered:
    17 Sep 2011
    04 Oct 2011
    Link to this post
    What path I can place /hhh/sss.cs?
  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    04 Oct 2011
    Link to this post
    Hello Ishtiyaq,

    You can put the file in SitefinityWebApp or inside a custom class library and make needed references between the project and class library.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
5 posts, 0 answered