How to access the text within two tags from the codebehind
I have a Repeater
which has HyperLinks
inside of it. This gets binded at the OnInit()
method. The HyperLinks
look like:
<asp:HyperLink runat="server" ID="hl" NavigateUrl='<%# GetNotificationDetailsUrl(Eval("Id")) %>' Target="_blank"> <asp:Image runat="server" ImageUrl='<%# "~/Images/Notifications/" + Eval("Type") + ".png" %>' /> <%# ResolveMessage(Container.DataItem) %> </asp:HyperLink>
So, there is text within two tags rather than in the Text
attribute (notice the Image
).
Is there any way to access this text at the Page_Load
method (ie. once everything is binded)? I want to loop through the Repeat开发者_高级运维er
and check if the text="foo" etc etc.
You need to check the text="foo" during data binding, not after databinding.
Repeater.ItemDataBound
精彩评论