I have a public property in my code-behind that I want to bind it to my control in .aspx page. If I use Page.DataBind() it works but I don’t want to use this as this causes recursive data bind to all controls.
Even if Page.DataBind() had an overloaded method which accepted boolean indicating whether I want to call it recursively or not, it would have been a better option but at the moment it will only degrade performance due to recursion.
My only objective is to bind public/protected properties in my code-behind page to my .aspx page. Is there any better alternative?
I guess your binding code is somethong like
This kind of binding will occur only if if you call
Page.DataBind(), but if you write:then you don’t have to call
Page.DataBind()