Reputation: 23
I know in MVC you could do this.GetLayoutItem<Model>()
to get the datasource of rendering on a page. How do we make use of this in sublayouts (.ascx)?
Upvotes: 1
Views: 461
Reputation: 2077
If you inherit your user control from the GlassUserControl
the AbstractGlassUserControl
has properties for LayoutItem
which will give you the datasource if its defined or there is a DataSourceItem
property which returns the datasource explicitly.
Upvotes: 1