开发者

Creating binding in codebehind

开发者 https://www.devze.com 2023-03-30 16:03 出处:网络
I have this type of code in aspx but wish to gene开发者_运维问答rate it in code behind.What would be the equivalent?

I have this type of code in aspx but wish to gene开发者_运维问答rate it in code behind. What would be the equivalent?

<uc1:editformcontrol ID="EditFormControl1" runat="server" CategoryID=' <%#Bind("CategoryID") %>' />

The question pertains mainly to the binding


It's difficult to say without knowing your data model. What kind of data source are you using? You could try adding this line to the Page_Load method:

int categoryId;
categoryId = WHEREEVER YOU'RE STORING THIS VALUE...
EditFormControl1.CategoryID = categoryId;


Usually, you override the OnDataBound event on your control and bind the data there.

See here one example.

0

精彩评论

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

关注公众号