title: Get rendering parameters when multiple sublayouts of the same type are on the page
body: <p>I need to get the rendering parameters programmatically from my sublayout. Currently I do this as such:</p>
  
  <pre><code>var sublayout = ((Sublayout)this.Parent);
  //Get all rendering
  var renderings = Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, true);
  
  //Get the first rendering that matches the current sublayout's path
  var sublayoutRendering = renderings.FirstOrDefault(r =&gt; r.RenderingItem.InnerItem["Path"] == sublayout.Path);
  
  if (sublayoutRendering != null)
      Response.Write(sublayoutRendering.RenderingItem.Parameters);
  </code></pre>
  
  <p>This solution came from <a href="https://stackoverflow.com/questions/5949214/sitecore-how-to-use-sublayout-parameters-from-codebehind">this question</a> and works perfectly until I have two sublayouts of the same type on the page. When this occurs obviously <code>renderings.FirstOrDefault(r =&gt; r.RenderingItem.InnerItem["Path"] == sublayout.Path);</code> always returns the first rendering parameter that matches the sublayouts path for <em>both</em> sublayouts.</p>
  
  <p>How can I differentiate between them? I can see nothing that I can use to tie them together!</p>
  
  <hr>
  
  <p><strong>Edit:</strong> </p>
  
  <p>To be clear, I add my sublayout in <em>Presentation > Details</em>, then when I click my control I set the fields in the '<em>Control Properties</em>' window. I have a field called Module Source which always comes back the same - it always populates as the one highest up in the order. The values are definitely different for each sublayout but I cannot get them from the renderings.</p>