我想在我的转发器上显示电子邮件链接(如果用户选择显示他/她的电子邮件地址),但我得到的只是Databinder.Eval(Container.DataItem, "emailaddress")
对实际链接的写入。它没有被解析,因为它应该......
这是我的标记:
<asp:Repeater runat="server" ID="rptGuestbook" OnItemCommand="rptGuestbook_ItemCommand"
OnItemDataBound="rptGuestbook_ItemDataBound" DataSource="<%# guestbookData %>">
<ItemTemplate>
<div runat="server" id="divPost" class="post">
<div runat="server" id="divAuthor" class="author">
<asp:Panel runat="server" ID="pnlAdmin" CssClass="delete-button" Visible="false">
<asp:Button runat="server" ID="btnDeletePost" CssClass="button" Text="Delete Post"
CommandName="DeletePost" CommandArgument='<%# Eval("postid") %>' />
<asp:Label runat="server" ID="lblShowEmail" Text='<%# Eval("showemail") %>' CssClass="hidden"></asp:Label>
</asp:Panel>
<ul>
<li>#<%# Eval("postid") %></li>
<li><span>Posted By: </span>
<%# Eval("postauthor") %><br />
<li>
<asp:HyperLink runat="server" ID="lnkWeb" ImageUrl="~/Images/webicon.png" NavigateUrl='<%# Eval("webaddress") %>'></asp:HyperLink></li>
<li>
<asp:HyperLink runat="server" ID="lnkEmail" ImageUrl="~/Images/emailicon.png" NavigateUrl='mailto: <%# DataBinder.Eval(Container.DataItem, "emailaddress" %>'></asp:HyperLink></li>
</ul>
</div>
<div runat="server" id="divMessage" class="post-message">
<div class="post-date">
<span>Posted On:</span>
<%# Eval("postdate") %></div>
<%# Eval("postmessage") %></div>
<div class="scroll">
</div>
</div>
</ItemTemplate>
</asp:Repeater>
<asp:HyperLink runat="server" ID="lnkEmail" ImageUrl="~/Images/emailicon.png" NavigateUrl='mailto: <%# DataBinder.Eval(Container.DataItem, "emailaddress" %>'></asp:HyperLink>
这正是我的浏览器认为链接的内容......
%20<%#%20DataBinder.Eval(Container.DataItem,%20"emailaddress"%20%>
我检查过,每一行都有一个电子邮件地址,所以我真的不明白为什么会这样。
谁能帮我解决它?
提前致谢!