Saturday, February 13, 2010

WebControl Event's Not working?... Here is the solution.

Few days back i had a strange issue during my webcontrol development .The issue was that child control events like button click’s , DropDownlist’s SelectedIndexChanged are not working. On a simple glance everything was done as per the regular flow of coding… I search on Bing,Live,Google etc…. Didnt find much effective solution on the first day.. On a deep dive to webcontrol development i found some articles,books,blogs that mentioning about the influence of implementation INamingContainer interface to the WebControl Class. Actually this interface does nothing when we do the implementation . Means we except must implemented functions from the interface. But in case INamingContainer there is nothing like that… its a marker interface.By this interface it allows unique naming of the dynamically generated server control instances within the WebControl.

Please go through this link to see the creation of sample webcontrol.