Dynamic content - Render linkbutton and capture event?

Vote:
 

Hi!

Is it possible to use Dynamic content and render an ASP.NET LinkButton and somehow capture the event when someone clicks the button? Or is Dynamic content just meant for outputting data, without interactivity?

If it is indeed possible, I would appreciate some small code sample to get me on the right track.

 

//Marcus

#55379
Nov 30, 2011 14:25
Vote:
 

Hello,

You can use a usercontrol (.ascx) as dynamic content. Not for just ouput but also user interaction. Here is an great article http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-6/EPiServer-CMS-6-R2/Dynamic-Content/.

#55392
Dec 01, 2011 1:22
Vote:
 

Thanks!

I guess I will have to return a reference to a user control in the implemented method GetControl, and return true in RendersWithControl.

#55397
Dec 01, 2011 9:06
Vote:
 

Either that or turn the user control directly into a dynamic content plugin: http://tedgustaf.com/en/blog/2011/4/creating-dynamic-content-in-episerver-cms-6-r2/

Doing it the "old school" way gives you more control though, and beware that there is a flaw in the implementation of property storage when you use the decoreate-usercontrol-approach that will garble up your data if you add a property to your dynamic content at a later stage: http://world.episerver.com/Blogs/Magnus-Rahl/Dates/2011/4/Property-problems-in-DynamicContentBase--Control-based-Dynamic-content/

#55400
Dec 01, 2011 9:48
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.