我们知道列表可以方便的显示数据,可以对同一个列表建立多个视图,在视图中决定要显示哪些字段等
如果想更方便的控制显示,可以在sharepoint designer中把这个视图转成数据视图,可以根据页面参数来进行筛选:
例如 http://xxx/page.aspx?name=xx&email=xx, 这里, 我们想获取name和email的value. 用sharepoint designer打开页面, 在code窗口里找到该dataview的描述, 找到
<
dvwp:ParamBindings
>
<![CDATA[
<ParameterBindings xmlns="http://schemas.microsoft.com/office/fpddw">
<ParameterBinding Name="dvt_adhocmode" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_adhocfiltermode" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_fieldsort" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdisplay" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_grouptype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sorttype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupsorttype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterval" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filtertype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="filterParam" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings> ]]> </ dvwp:ParamBindings >
<ParameterBindings xmlns="http://schemas.microsoft.com/office/fpddw">
<ParameterBinding Name="dvt_adhocmode" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_adhocfiltermode" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_fieldsort" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdisplay" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_grouptype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sorttype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_groupsorttype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filterval" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_filtertype" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="filterParam" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</ParameterBindings> ]]> </ dvwp:ParamBindings >
我们可以发现在用筛选的时候, 有两个sharepoint自己提供的属性UserID和Today, 这里我们可以添加自己的
<
ParameterBinding
Name
="_name"
Location
="Postback;QueryString(name)"
DefaultValue
=""
/>
< ParameterBinding Name ="_email" Location ="Postback;QueryString(email)" DefaultValue ="" />
< ParameterBinding Name ="_email" Location ="Postback;QueryString(email)" DefaultValue ="" />
这时, 我们就可以通过dataview的筛选来使用自定义参数了。
当然用右边小箭头里面的菜单一样可以达到要求
本文转自永春博客园博客,原文链接:http://www.cnblogs.com/firstyi/archive/2007/12/04/982395.html,如需转载请自行联系原作者