我在编辑列的时候,增加一个imagefield,在他的属性DataAlternateTextField中设置了数据中存放图片路径的字段,结果发布页面的时候,图片路径后面多了一串字符。这样:http://localhost:23904/test/images/01.gif%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20正常应该是:http://localhost:23904/test/images/01.gif
DataAlternateTextField我也放置了图片地址,但是它显示的就是images/01.gif而图片的url 显示的是:http://localhost:23904/test/images/01.gif%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" AllowPaging="True" AllowSorting="True">
<Columns>
<asp:BoundField DataField="pID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="pID" />
<asp:BoundField DataField="pName" HeaderText="名称" SortExpression="pName" />
<asp:BoundField DataField="pSex" HeaderText="性别" SortExpression="pSex" />
<asp:BoundField DataField="pOther" HeaderText="其他" SortExpression="pOther" />
<asp:BoundField DataField="pSalary" HeaderText="薪水" SortExpression="pSalary" />
<asp:ImageField DataAlternateTextField="imgUrl" DataImageUrlField="imgUrl" HeaderText="图片">
</asp:ImageField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString2 %>" SelectCommand="SELECT * FROM [people]"></asp:SqlDataSource>