开发者

Binding for user controls embedded in page

开发者 https://www.devze.com 2023-01-30 14:46 出处:网络
I have an ASP.NET page where I call this.DataBind() to bind the controls. I also have various user controls embedded. One has a drop down list, the bind statement gets called for it 2x but the sender

I have an ASP.NET page where I call this.DataBind() to bind the controls. I also have various user controls embedded. One has a drop down list, the bind statement gets called for it 2x but the sender the first time is not th开发者_运维技巧e drop down list.

Am I using the databind incorrectly? I use databind to get the properties of my page bound to a datasource so that I can use those properties in the declarative code.

In my DropDownList, I added if (sender == dropDownList) which solved the problem


Make sure that none of your user controls are themselves calling .DataBind()

.

0

精彩评论

暂无评论...
验证码 换一张
取 消