用过sharepoint的朋友可能都用到过sharepoint的dataview, 并且通过筛选来达到显示我们需要的数据的目的, 那么如何从url querystring中获得参数, 例如 http://xxx/page.aspx?name=xx&email=xx, 这里, 我们想获取name和email的value. 用frontpage打开页面, 在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>我们可以发现在用筛选的时候, 有两个sharepoint自己提供的属性UserID和Today, 这里我们可以添加自己的
<ParameterBinding Name="_name" Location="Postback;QueryString(name)" DefaultValue=""/>
<ParameterBinding Name="_email" Location="Postback;QueryString(email)" DefaultValue=""/>这时, 我们就可以通过dataview的筛选来使用自定义参数了。
转载于:https://www.cnblogs.com/Stephen/archive/2005/11/21/281206.html