Return to Snippet

Revision: 35343
at November 8, 2010 23:09 by hstidsen


Updated Code
private NameValueCollection _parameters = null;
private NameValueCollection parameters
{
    get
    {
        if (_parameters == null)
        {

            if (String.IsNullOrEmpty(this.Attributes["sc_parameters"]))
                return new NameValueCollection();
            else
                _parameters = WebUtil.ParseUrlParameters(this.Attributes["sc_parameters"]);
        }

        return _parameters;
    }
}

Revision: 35342
at November 5, 2010 20:23 by hstidsen


Initial Code
private NameValueCollection _parameters = null;
private NameValueCollection parameters
{
    get
    {
        if (_parameters == null)
            _parameters = WebUtil.ParseUrlParameters(this.Attributes["sc_parameters"]);

        return _parameters;
    }
}

Initial URL

                                

Initial Description
Gets parameters set on the sublayout in presentation details as a property, just use parameters["paramname"] to get a value.
Needs ref to Sitecore.Kernel.dll and "using Sitecore.Web;".

Initial Title
Get sublayout parameters from usercontrol

Initial Tags

                                

Initial Language
C#