<a href="Details.aspx?id=<%# DataBinder.Eval(Container.DataItem, "id")%>
&type=<%# DataBinder.Eval(Container.DataItem, "type")%>
&product_type=<%# DataBinder.Eval(Container.DataItem, "product_type")%>" target="center-content"> <%#Eval("[\"product_desc\"]")%> </a></div>
如何在前台为id等参数加上server.urlEncode
&type=<%# DataBinder.Eval(Container.DataItem, "type")%>
&product_type=<%# DataBinder.Eval(Container.DataItem, "product_type")%>" target="center-content"> <%#Eval("[\"product_desc\"]")%> </a></div>
如何在前台为id等参数加上server.urlEncode
参考
<%=Server.UrlEncode(string)%>
估计可以吧。
lz这样写代码眼会花的,
直接点
<a href="<% string.Format("Details.aspx?id={0}&type={1}&product_type={2}",
ServerUrlEncode(Eval("id")).ToString()),
ServerUrlEncode(Eval("type").ToString()),
ServerUrlencode(Eval("product_type").ToString()) %>"></a>
<%# Server.UrlDecode(Eval("id").ToString()) %>