I am loading 3 custom widgets, that we created on PageLoad.
Each of these widgets are separate instances of the same object - an "AnswerKey"
When these each load I want to get the guid for that instance of the AnswerKey.
In debug, I can see the unique values for each of the properties of that instance of an AnswerKey, such as, answers, title, course; but I can't find the guid.
How do I get the guid for a particular instance of a widget while in the InitializeControls method?
Posted by Community Admin on 15-Sep-2011 00:00
Do you mean InitializeControls method of your own widget? Then you first must get a reference to the Page where the widget is, for example:
var manager = PageManager.GetManager();
var page = manager.GetPageNodes().Where(p => p.Title == "Title").FirstOrDefault();
foreach(var control inpage.Page.Controls)
var loaded = manager.LoadControl(control);
var guid = loaded.ID;
Here I check for ContentBlock, however in your case this will be different.
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items