有没有很好的参考 SharePoint 的数据绑定语法? [英] Is there a good reference SharePoint's databinding syntax?

查看:50
本文介绍了有没有很好的参考 SharePoint 的数据绑定语法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 SharePoint Designer 将 asp 服务器控件放入我的 SharePoint XSLT.我发现将值预填充到表单中或提供与 SharePoint 定义的布局(隐藏字段等)不同的体验非常方便.

I'm putting asp server-controls into my SharePoint XSLT using SharePoint Designer. I've found it's really handy for pre-populating values into the form, or providing a different experience than the SharePoint defined layout (hidden fields, etc).

例如,如果我这样定义,我可以使用 asp:TextBox 控件而不是 SharePoint:FormField 控件:

For example, I can use a asp:TextBox control instead of the SharePoint:FormField control if I define it as such:

<xsl:stylesheet ... xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime">
   <xsl:param name="Name" />

   <xsl:template match="/">
       <!-- omitted for clarity -->

       <asp:TextBox id="txtName" runat="server" Text="{$Name}"
         __designer:bind="{ddwrt:DataBind('i','txtName','Text','TextChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@MySharePointField')}"

   </xsl:template>
</xsl:stylesheet>

我已经用谷歌搜索过,但似乎找不到 ddwrt:DataBind 方法参数的好参考.

I've googled but can't seem to find a good reference for the parameters for ddwrt:DataBind method.

有人知道吗?

推荐答案

ddwrt:DataBind 方法是 DataFormWebPart.AddDataBinding

The ddwrt:DataBind method is a wrapper for DataFormWebPart.AddDataBinding

神秘的第一个参数指的是操作".它将是i"(插入)、u"(更新)或d"(删除).遗憾的是,这些是文字值,因为 XSLT 无法访问枚举等.

The mysterious first parameter refers to the "operation". It will either be "i" (insert), "u" (update), or "d" (delete). Sadly, these are literal values because the XSLT doesn't have access to enumerations, etc.

其他奇怪的字段是 propertyName 和 eventName,它们是您要绑定的控件的成员.事件使用反射连接到共享点表单,属性用于检索值.

The other curious fields are the propertyName and eventName, which are members of the control you're binding. The event is wired up using reflection to the sharepoint form, and the property is used to retrieve the value.

其余字段指的是要绑定的主键和值.

The remaining fields refer to the primary key and value to bind.

可以找到有关方法签名及其使用方法的完整详细信息这里

这篇关于有没有很好的参考 SharePoint 的数据绑定语法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆