绑定GridView中Image控件的ImageUrl
<asp:GridView Width="500px" ID="gvImages" runat="server"
AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText = "Image Name"
DataField="imagename" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/UploadFiles/"+ <%# Eval("PRODUCT_PICTRUE") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
AutoGenerateColumns="False" >
<Columns>
<asp:BoundField HeaderText = "Image Name"
DataField="imagename" />
<asp:TemplateField HeaderText="Image">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "~/UploadFiles/"+ <%# Eval("PRODUCT_PICTRUE") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
ImageUrl='<%# "~/UploadFiles/"+ <%# Eval("PRODUCT_PICTRUE") %>'
或
ImageUrl='<%# Eval("FileName", "images/{0}") %>'
附记:<%# Eval("RuleTitle").ToString().Length>16?Eval("RuleTitle").ToString().Substring(0,16)+"":Eval("RuleTitle") %>'