Posted By

hstidsen on 11/05/10


Tagged

sitecore UserControl sublayout


Versions (?)

Get sublayout parameters from usercontrol


 / Published in: C#
 

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;".

  1. private NameValueCollection _parameters = null;
  2. private NameValueCollection parameters
  3. {
  4. get
  5. {
  6. if (_parameters == null)
  7. {
  8.  
  9. if (String.IsNullOrEmpty(this.Attributes["sc_parameters"]))
  10. return new NameValueCollection();
  11. else
  12. _parameters = WebUtil.ParseUrlParameters(this.Attributes["sc_parameters"]);
  13. }
  14.  
  15. return _parameters;
  16. }
  17. }

Report this snippet  

You need to login to post a comment.