Compare value of QueryString with value from Repeater's DataSource
I have a <asp:Repeater>
and I need to show/hide a button inside it depending on the value of a specific field from it's DataSource
. As you can see in the code below, I'm trying to compare Eval("ProcessId") == Request.QueryString["ProcessId"]
. Is it possible? What am I doing wrong? Is it possible to compare this value to, let's say, a Control
(like a TextBox
) on the page?
<asp:Button runat="server" ID="buttonDelete" Visible="<% Eval("ProcessId") == Request.QueryString["ProcessId"] ? 'false' : 'true' %>" CommandName="Delete" CommandArgument='<%# Eval("UniqueId") %>' Text="Delete" /&开发者_如何学Cgt;
It works if you cast Request.QueryString
to string
<asp:Button runat="server" ID="buttonDelete"
Visible='<%# Eval("ProcessId") == (string)Request.QueryString["ProcessId"] ? false : true %>' CommandName="Delete" />
精彩评论