Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:44:17+00:00 2026-05-26T04:44:17+00:00

I want to create a Sitecore sublayout like the following: <sc:Sublayout runat=server ID=slMySublayout Path=~/layouts/My

  • 0

I want to create a Sitecore sublayout like the following:

<sc:Sublayout runat="server" ID="slMySublayout" Path="~/layouts/My Sublayout.ascx" MyCustomProperty="some value" />

I was hoping that since a Sitecore sublayout is inherited from an ASP.NET user control that I would be able to create a public property called “MyCustomProperty” and get at the value that was set declaritively for the sublayout. However that doesn’t seem to work. The public property never seems to get set with the value entered on the ASCX file.

Does anyone know if this is possible?

Thanks,
Corey

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:44:18+00:00Added an answer on May 26, 2026 at 4:44 am

    I figured it out. Instead – you write your sublayout tag like this:

    <sc:Sublayout runat="server" ID="slMySublayout" Path="~/layouts/My Sublayout.ascx" Parameters="MyCustomProperty=somevalue" />
    

    Then make sure that your sublayout inherits from SublayoutBase (shared source – http://trac.sitecore.net/SublayoutParameterHelper/browser/Trunk/Web/UI/Sublayouts/SublayoutBase.cs). As long as you have a public property on your sublayout called MyCustomProperty, then it will get set correctly at load. If you have multiple properties you can just set them all in the Parameters section – just use an ampersand between them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want create a command that has the following structure command path/to/some/file How do
I want to create an item to sitecore using code behind. I found this
I want create something that looks like the MSN Messenger chat forms. I am
I want create Word document from another Word document, but I need replace some
I'm building multiple language sites with Sitecore 6.2. In some cases we want the
I want create some view, and add dynamically to it text and images Somebody
I want to create custom index in Sitecore 6.5 through C#. I read this
I want create MenuStrip dynamic (in winform C#.Net 4.0) From Database (SQL Server) and
I want create a form to upload files (txt, xls) to the server, not
I want create subdomains like this: domain.com/type/city An examples: domain.com/restaurants/new_york domain.com/hotels/new_york domain.com/restaurants/chicago I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.