SearchDocuments/queries.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<h3>
文档的扩展控件查询</h3>
查询汽车库中所有的中型车
<pz:SearchDocuments ID="SearchDocuments1" runat="server" Path="/sample/pinpai/" PageSize="10">
<HeaderTemplate>
<table width="500" border="1">
<tr>
<th>
车的名称</th>
<th>
车型</th>
<th>价格</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Eval("subject") %>
</td>
<td>
<%# ((Document)Container.DataItem).Profile.GetPropertyValue("车型") %>
</td>
<td>
<%# ((Document)Container.DataItem).Profile.GetPropertyValue("价格") %>万元
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></FooterTemplate>
<Sorts>
<pz:Sort SortBy="subject" SorOrder="Ascending" />
</Sorts>
<Queries>
<pz:TermQuery PropertyDefinitionID="6" QueryKeyWord="中型车" />
</Queries>
</pz:SearchDocuments>
<p></p>
查询汽车库中价格大于等于15万小于等于30万,且车型为中型车的车型列表
<pz:SearchDocuments ID="SearchDocuments2" runat="server" Path="/sample/pinpai/" PageSize="10">
<HeaderTemplate>
<table width="500" border="1">
<tr>
<th>
车的名称</th>
<th>
车型</th>
<th>价格</th>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Eval("subject") %>
</td>
<td>
<%# ((Document)Container.DataItem).Profile.GetPropertyValue("车型") %>
</td>
<td>
<%# ((Document)Container.DataItem).Profile.GetPropertyValue("价格") %>万元
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></FooterTemplate>
<Sorts>
<pz:Sort SortBy="subject" SorOrder="Ascending" />
</Sorts>
<Queries>
<pz:TermQuery PropertyDefinitionID="6" QueryKeyWord="中型车" />
<pz:RangeQuery PropertyDefinitionID="7" Lower="15" Upper="30" />
</Queries>
</pz:SearchDocuments>
</form>
</body>
</html>