开发者

Compare value of QueryString with value from Repeater's DataSource

开发者 https://www.devze.com 2023-02-28 03:26 出处:网络
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

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" />
0

精彩评论

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