SharePoint中。如何访问RenderingTemplate中的对象 [英] Sharepoint. How to access objects in RenderingTemplate
本文介绍了SharePoint中。如何访问RenderingTemplate中的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在处理渲染模板(Sharepoint 2010),使用我自己的代码来替代标准的新/编辑/显示表单,但我无法从RenderingTemplate类中获取代码中的对象。
for例如:
< SharePoint:RenderingTemplate ID =ParentItemsListViewrunat =server>
< Template>
< table cellpadding = 0 cellspacing = 0>
< tr>< td nowrap class =class1>< asp:Label ID =label1runat =server/>< / td>< / tr>
< tr>< td>< SharePoint:FieldLabel runat =serverID =TitleDescriptionFieldControlMode =EditFieldName =Title/>< / td>< / tr>
< / table>
< / Template>
我需要自定义FieldLabel对象。
我希望有人能帮助我。
解决方案
您应该能够像这样得到它:
< $ FieldBlank fieldLabelControl = ParentItemsListView.FindControl(TitleDescriptionField)作为FieldLabel; pre>
if(fieldLabelControl!= null)
{
//做点什么
}
I'm working on rendering templates (Sharepoint 2010), overrided standart new/edit/display forms with my own, but I can't get objects in code-beghind from inside RenderingTemplate class. for e.g:
<SharePoint:RenderingTemplate ID="ParentItemsListView" runat="server">
<Template>
<table cellpadding=0 cellspacing=0>
<tr><td nowrap class="class1"><asp:Label ID="label1" runat="server" /></td></tr>
<tr><td><SharePoint:FieldLabel runat="server" ID="TitleDescriptionField" ControlMode="Edit" FieldName="Title" /></td></tr>
</table>
</Template>
I need to custom FieldLabel object.
I hope someone could help me. Thanks.
解决方案
You should be able to get it like this:
FieldLabel fieldLabelControl= ParentItemsListView.FindControl("TitleDescriptionField") as FieldLabel;
if(fieldLabelControl != null)
{
//Do something with it
}
这篇关于SharePoint中。如何访问RenderingTemplate中的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文