Why using DataBind ( )?!!!
-
I’m developing a Data-Bound Web Control and I read all articles about this subject but still I have this problem, I don’t know why do we need the DataBind ( ) function to bind the data to the control, why don’t we do it in the Render function or anywhere else, all what I got from articles that it give the user the ability to specify the time of binding the data to the control but why is that???
-
I’m developing a Data-Bound Web Control and I read all articles about this subject but still I have this problem, I don’t know why do we need the DataBind ( ) function to bind the data to the control, why don’t we do it in the Render function or anywhere else, all what I got from articles that it give the user the ability to specify the time of binding the data to the control but why is that???
Hi there, Here are just my private thoughts on this issue. When you develop a data-bound control, your control inherits the Control either directly or indirectly, and your control needs to override the DataBind method to provide data-binding logic. When it is called on a server control, this method resolves all data-binding expressions in the server control and in any of its child controls. I'm not sure whether you have tried these links or not, but I think that might help you a bit anyway. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWebUIControlClassDataBindTopic.asp[^] http://support.microsoft.com/kb/313481/EN-US[^]