每当我将我的 descprtion url 绑定到数据源时,它都会评估该项目,但会在其间添加这些奇怪的“%20”。
IE
果冻%20鱼
此代码在我的图像的标题属性中完美运行,即
<li><asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# "getImage.ashx?ImID="+ Eval("ID") %>' title='<%# Eval("imagename") %>' DescriptionUrl='<%# Eval("Description") %>' />
</ItemTemplate>
</asp:Repeater></li>
我如何解码这个描述网址?
这是我的 C# 代码:
SqlConnection connection = new SqlConnection(strcon);
string querystring = "SELECT image, description ,imagename, id from table where startdate <= CONVERT (date, SYSDATETIME())and endate >= CONVERT (date, SYSDATETIME())";
SqlCommand command = new SqlCommand(querystring, connection);
SqlDataAdapter daimages = new SqlDataAdapter(command);
DataTable dt = new DataTable();
daimages.Fill(dt);
Repeater1.DataSource = dt;
Repeater1.DataBind();