注册 登录
编程论坛 ASP.NET技术论坛

求助 前台调用后台代码的问题

hxbag_102 发布于 2013-08-08 12:59, 829 次点击
根据数据库的值判断Reperter中是否显示图片,代码如下,报错RepairInfolist.IsShowEditButtion(string)最匹配的重载方法具有一些无效参数,问题出在什么地方,请教下。
前台代码:
<asp:Repeater ID="Repeater1" runat="server" >
    <ItemTemplate >
        <div id="publish_user" class="publish_user">
            <div id="publish_user_top" class="publish_user_top ">
                <div id="user" class="user">
                    <asp:Label ID="lbUserName" runat="server" Text='<%# Eval("Name")%>'></asp:Label>
                </div>
               
                <div id="publish_content" class="publish_content">
                    <div id="publish_content_top" class="publish_content_top"></div>                    
                    <asp:Label ID="lbReplyText" runat="server" Text='<%# Eval ("text") %> '></asp:Label>
                </div>
            </div>
            <div id="user_bottom" class="user_bottom">
                <asp:Label ID="lbReplyTime" runat="server" Text='<%# Bind("Create_time") %>'></asp:Label>
            </div>
            <div id="publish_content_bottom" class="publish_content_bottom">
                <asp:Image ID="imgReplyReply" runat="server" ImageUrl="~/Image/reply.gif" />
                <asp:Image ID="imgReplyReplya" runat="server" ImageUrl="~/Image/reply_a.gif" />
                <asp:Image ID="imgReplyEdit" runat="server" ImageUrl="~/Image/edit.gif" Visible = '<%# IsShowEditButtion(Eval("user_id")%>' />               
                <asp:Image ID="imgRelyUp" runat="server" ImageUrl="~/Image/p_up.gif"  />
            </div>
        </div>   
    </ItemTemplate>
 </asp:Repeater>
后台代码:
 public bool  IsShowEditButtion(string str)
        {
            string Corrent = Session [Session .SessionID ].ToString ();
            if (Corrent == str)
            {
                return true    ;
            }
            else
            {
                return false  ;
            }
        }
2 回复
#2
shangsharon2013-08-08 14:50
Visible = '<%# IsShowEditButtion(Eval("user_id")%>'
改成
Visible = '<%# IsShowEditButtion(Eval("user_id").ToString())%>'
#3
hxbag_1022013-08-09 08:37
谢谢,搞定。
1