还是会出错阿: Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.HttpServerUtility.UrlEncode(string)' has some invalid argumentsSource Error:Line 17: <asp:TemplateColumn HeaderText="图片"> Line 18: <ItemTemplate> Line 19: <a href='ProjectBrowse.aspx?ImageID=<%# Server.UrlEncode(DataBinder.Eval(Container.DataItem, "id"))%>' target=_parent> Line 20: <img id="img2" src='<%# DataBinder.Eval(Container.DataItem, "id","images/{0}_1.jpg")%>' style="border-color:White;border-width:2px;border-style:Outset;height:50px;width:80px;" runat=server alt='<%# DataBinder.Eval(Container.DataItem,"name")%>'> Line 21: </a>
<# Server.UrlEncode(DataBinder.Eval(Container.DataItem, "name"))%>
这样子系统报错
Compiler Error Message: CS1502: The best overloaded method match for 'System.Web.HttpServerUtility.UrlEncode(string)' has some invalid argumentsSource Error:Line 17: <asp:TemplateColumn HeaderText="图片">
Line 18: <ItemTemplate>
Line 19: <a href='ProjectBrowse.aspx?ImageID=<%# Server.UrlEncode(DataBinder.Eval(Container.DataItem, "id"))%>' target=_parent>
Line 20: <img id="img2" src='<%# DataBinder.Eval(Container.DataItem, "id","images/{0}_1.jpg")%>' style="border-color:White;border-width:2px;border-style:Outset;height:50px;width:80px;" runat=server alt='<%# DataBinder.Eval(Container.DataItem,"name")%>'>
Line 21: </a>
<a href='ProjectBrowse.aspx?ImageName=<%# Server.UrlEncode(DataBinder.Eval(Container.DataItem, "name","{0}"))%>&ImageID=<%# DataBinder.Eval(Container.DataItem, "id")%>' target=_parent>加一个"{0}"格式化一下就可以了
多谢