<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Master</title>
<script runat="server">
</script>
</head>
<body>
<form runat="server">
<div>
<asp:GridView
DataSource
AutoGenerateColumns="false"
Runat="server">
<Columns>
<asp:HyperLinkField
HeaderText="Movie Categories"
DataTextField="Name"
DataNavigateUrlFields="Id,Name"
DataNavigateUrlFormatString="Details.aspx?id={0}&Title={1}" />
</Columns>
</asp:GridView>
<asp:SqlDataSource
ConnectionString="<%$ ConnectionStrings:Movies %>"
SelectCommand="SELECT Id, Name FROM MovieCategories"
Runat="server" />
</div>
</form>
</body>
</html>
如上代码,浏览器会把链接解析为<td><a href="Details.aspx?id=1&Title=Adventure">Adventure</a></td>
请问有什么好的解决方法?
Web标准中就推荐用&不要用&
对啊,可是我需要用的是解析正常的href,解析成&的话,我还怎么用链接?
@微澜: 改为这样试试:
Details.aspx?id={0}&Title={1}