开发者

How to databind a property on a custom user control?

I have a custom user control UserProfileLink on which I have two basic string properties, UID and UserFullName which I would like to use in a template column in a DataGrid like this:

....
<ItemTemplate>
  <td:UserProfileLink ID="uplUser" runat="server" UID="<%#Eval("UserUID") %>" UserFullName="<%#Eval("UserFullName") %>" />
</ItemTemplate>
....

I get an error saying开发者_运维技巧 "The server tag is not well formed" which leads me to believe this type of binding isn't possible. Is there a way to do this, or is it impossible?


Try ' instead of " for the server tag

<td:UserProfileLink ID="uplUser" runat="server" UID='<%#Eval("UserUID") %>' UserFullName='<%#Eval("UserFullName") %>' />

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜