Hi, I've got a template which is both used as an include on a normal ecom product catalog template and on product templates...
What I would like to achieve is to have my wrapping element given a unique ID each time this include/template is rendered. So if rendered 3 times on the same page, each element gets a unique id - ie:
<div id="uniquenumber">my stuff</div>
Is there in Razor a way to have some kind of way/function to stores the initial value, and each time it's called it increments by +1 and outputs that value?
Would be nice if possible to do like this RenderUniqueID("SomeCSSText") resulting in ie: SomeCSSText123
PS: the uniqueness of these numbers only need to be related to each page load... so i.e. if paragraphs are sorted differently the id's dont have to stick to the item/paragraph... they only need to be unique on that page and that page load...