如何从.aspx页中的列表视图分配Eval值 [英] How to assign Eval value from listview in .aspx page
问题描述
在列表视图中,我正在显示广告系列数据以供编辑.
每行只有一个编辑链接按钮.如果用户已登录,则我将显示此按钮
像下面一样,
Hi,
In listview i am showing campaign data for editing purpose.
there is one edit linkbutton in each row.If user is logged, i am showing this button
like following,
<%
if (Session["session_log_id"] != null)
{
%>
<td class="command"><asp:LinkButton ID="btnEdit" runat="server" Text="Edit" CommandName="Edit" CausesValidation="false" /></td>
<%} %>
工作正常.
现在,如果当前用户是所有者perticuler广告系列,我想在行上看到此按钮.如何检查?
这是我当前的用户:
会话["session_log_id"]
我必须将其与:
its working fine.
Now i wants to visible this button for on row if current user is owner perticuler campaign.How to check it?
here my current user is :
Session["session_log_id"]
and i have to compare it to :
<%# Eval("log_id")%>
我试着像下面的那样,
I tried like following ,
int thisUserId = Convert.ToInt32( %> <%# Eval("log_id")%> <%);
然后比较,但不起作用.
请给出想法或更好的解决方案,谢谢..............
and then compare but it not working .
Please give idea or better solution thanks...........
推荐答案
将值(log_id)存储在Linkbutton
的CommandArgument
中.并将会话值与该CommandArgument
值&继续.
LinkButton命令参数 [
Store the value(log_id) inCommandArgument
ofLinkbutton
. And compare the session value with thatCommandArgument
value & go ahead.
LinkButton Command Arguments[^]
这篇关于如何从.aspx页中的列表视图分配Eval值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!