我一直在尝试通过依赖另一个 html 页面的表单来获取一个 aspx 页面来更改 sql 查询的顺序。它一直给我一个“解析器错误消息:服务器标签格式不正确。” 如何修复下面的代码?
<%
Dim SortingOrder = Request.QueryString("sortorder")
%>
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display.">
<Columns>
<asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" SortExpression="Id" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Summary" HeaderText="Summary" SortExpression="Summary" />
<asp:BoundField DataField="Body" HeaderText="Body" SortExpression="Body" />
<asp:BoundField DataField="GenreId" HeaderText="GenreId" SortExpression="GenreId" />
<asp:CheckBoxField DataField="Authorized" HeaderText="Authorized" SortExpression="Authorized" />
<asp:BoundField DataField="CreateDateTime" HeaderText="CreateDateTime" SortExpression="CreateDateTime" />
<asp:BoundField DataField="UpdateDateTime" HeaderText="UpdateDateTime" SortExpression="UpdateDateTime" />
</Columns>
</asp:GridView>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:PLANETWROX.MDFConnectionString1 %>" deletecommand="DELETE FROM [Review] WHERE [Id] = @Id" insertcommand="INSERT INTO [Review] ([Title], [Summary], [Body], [GenreId], [Authorized], [CreateDateTime], [UpdateDateTime]) VALUES (@Title, @Summary, @Body, @GenreId, @Authorized, @CreateDateTime, @UpdateDateTime)" providername="<%$ ConnectionStrings:PLANETWROX.MDFConnectionString1.ProviderName %>" selectcommand="SELECT [Id], [Title], [Summary], [Body], [GenreId], [Authorized], [CreateDateTime], [UpdateDateTime] FROM [Review] ORDER BY Request.QueryString("sortorder")" updatecommand="UPDATE [Review] SET [Title] = @Title, [Summary] = @Summary, [Body] = @Body, [GenreId] = @GenreId, [Authorized] = @Authorized, [CreateDateTime] = @CreateDateTime, [UpdateDateTime] = @UpdateDateTime WHERE [Id] = @Id">
<DeleteParameters>
<asp:Parameter Name="Id" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Summary" Type="String" />
<asp:Parameter Name="Body" Type="String" />
<asp:Parameter Name="GenreId" Type="Int32" />
<asp:Parameter Name="Authorized" Type="Boolean" />
<asp:Parameter Name="CreateDateTime" Type="DateTime" />
<asp:Parameter Name="UpdateDateTime" Type="DateTime" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="Title" Type="String" />
<asp:Parameter Name="Summary" Type="String" />
<asp:Parameter Name="Body" Type="String" />
<asp:Parameter Name="GenreId" Type="Int32" />
<asp:Parameter Name="Authorized" Type="Boolean" />
<asp:Parameter Name="CreateDateTime" Type="DateTime" />
<asp:Parameter Name="UpdateDateTime" Type="DateTime" />
<asp:Parameter Name="Id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True"
ShowSelectButton="True" ButtonType="Button"></asp:CommandField>
<asp:Database.Query(Select * From Review [Order By<% Response.Write(Request.QueryString("sortorder"))%>])></asp:Database.Query>
</form>