<td><% UserName((int)Eval("productUid")); %></td>方法
  public string UserName(int id)
        {
            return BusinessFacade.GetNameByUserId(id);
        }运行报错。。

解决方案 »

  1.   

    ><%=UserName((int)Eval("productUid")); %>
      

  2.   

    <%# UserName((int)Eval("productUid")); %>
      

  3.   

    <td><%# UserName((int)Eval("productUid")); %></td>
      

  4.   

    你那个是属于数据源绑定的,带有Eval,表达式应该需要#
      

  5.   

    如果UserName()是后台的方法加个"="<%= UserName((int)Eval("productUid")) %>就可以
    如果是code里边的就你写的那个就行
      

  6.   

    呵呵,没看见还有个Eval   楼上的对着
      

  7.   

    <%=%>赋值,<%#%>绑定数据源,<%$%>一段表达式
      

  8.   

    <td><% UserName((int)Eval("productUid")); %></td>方法
    public string UserName(int id)
    {
    return BusinessFacade.GetNameByUserId(id);
    }
    修改为:
    <td><%# UserName((int)Eval("productUid")); %></td>方法
    protected string UserName(int id)
    {
    return BusinessFacade.GetNameByUserId(id);
    }
      

  9.   

    <td><%# UserName((int)Eval("productUid")) %></td>
      

  10.   

    <%# UserName((int)Eval("productUid")); %>
      

  11.   

    <%=%>赋值,
    <%#%>绑定数据源,其中可以有c#运算
    <%$%>一段表达式
      

  12.   


    <td><%#UserName((int)Eval("productUid"))%></td>
      

  13.   

    <td><%# UserName((int)Eval("productUid")) %></td>
      

  14.   

    <td><% UserName((int)Eval("productUid")); %></td>方法
    public string UserName(int id)
    {
    return BusinessFacade.GetNameByUserId(id);
    }
    修改为:
    <td><%# UserName((int)Eval("productUid")); %></td>方法
    protected string UserName(int id)
    {
    return BusinessFacade.GetNameByUserId(id);
    }
      

  15.   

    <td><% UserName((int)Eval("productUid")); %></td>
      

  16.   

    # 号............参考这贴 http://topic.csdn.net/u/20100406/22/11e659d5-9a04-4a63-ba14-9014d759b710.html?seed=1022138645&r=64489587#r_64489587
      

  17.   

    >% UserName(Eval("productUid")); %
    public String UserName(object productUid)
    {
       .......
    }
    你的要提供数据源。