买个关子,明天再写。这个东西网络上面的资料不多。我是纯粹通过配置文件实现的。
买个关子,明天再写。这个东西网络上面的资料不多。我是纯粹通过配置文件实现的。
里面有三个lookup字段,然后将要关联的list的guid放在list字段中就可以了。
继续以前的。下载微软的 Visual Studio 2008 extensions for Windows SharePoint Services 3.0 (version 1.2)
建议一空项目。,然后添加一个contentType
在配置文件中申明要使用的字段。
Code
<?xml version="1.0" encoding="utf-8"?>
<Elements Id="ce51f872-41ef-41c5-bd79-f0e9a9ce10f0" xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentType ID="0x010200e22cfb46db684f208a8712b04c7f0297" Name="EventCastContentType" Group="Development" Description="Developing Content Type" Version="0">
<FieldRefs>
<FieldRef ID="{C1000005-5005-45BA-8E41-22E10C48E7C5}" Name="Legend" />
<FieldRef ID="{C1000005-4BA0-43F4-9552-A0C302AA8C42}" Name="Category" />
<FieldRef ID="{C1000005-6AFE-4DDE-BFE9-0A282C8730BA}" Name="Audience" />
<FieldRef ID="{C1000005-B0E3-4683-ADED-7EDA255F3EA9}" Name="PublishLocation" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<Receivers />
</XmlDocument>
</XmlDocuments>
</ContentType>
<Field ID="{C1000005-5005-45BA-8E41-22E10C48E7C5}" Type="Lookup" Name="Legend" StaticName="Legend" DisplayName="Legend" Group="*****" Required="TRUE" List="{05aaa2f2-4e66-41ce-91f9-6b1faf09c62e}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-4BA0-43F4-9552-A0C302AA8C42}" Type="Lookup" Name="Category" DisplayName="Category" StaticName="Category" Group="*****" Required="TRUE" List="{c426affc-9a52-4eab-8c98-a0db60fccfb4}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-B0E3-4683-ADED-7EDA255F3EA9}" Type="Lookup" Name="PublishedLocation" DisplayName="Published Location" StaticName="PublishLocation" Group="*****" Required="TRUE" List="{7ef36598-5d0b-4fbd-a8ec-d6524474a786}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-6AFE-4DDE-BFE9-0A282C8730BA}" Type="User" Mult="TRUE" Name="Audience" BaseType="Text" Sealed="TRUE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" ShowInListSettings="TRUE" DisplayName="Audience" Required="FALSE" Group="*****" />
</Elements>
<?xml version="1.0" encoding="utf-8"?>
<Elements Id="ce51f872-41ef-41c5-bd79-f0e9a9ce10f0" xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentType ID="0x010200e22cfb46db684f208a8712b04c7f0297" Name="EventCastContentType" Group="Development" Description="Developing Content Type" Version="0">
<FieldRefs>
<FieldRef ID="{C1000005-5005-45BA-8E41-22E10C48E7C5}" Name="Legend" />
<FieldRef ID="{C1000005-4BA0-43F4-9552-A0C302AA8C42}" Name="Category" />
<FieldRef ID="{C1000005-6AFE-4DDE-BFE9-0A282C8730BA}" Name="Audience" />
<FieldRef ID="{C1000005-B0E3-4683-ADED-7EDA255F3EA9}" Name="PublishLocation" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/events">
<Receivers />
</XmlDocument>
</XmlDocuments>
</ContentType>
<Field ID="{C1000005-5005-45BA-8E41-22E10C48E7C5}" Type="Lookup" Name="Legend" StaticName="Legend" DisplayName="Legend" Group="*****" Required="TRUE" List="{05aaa2f2-4e66-41ce-91f9-6b1faf09c62e}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-4BA0-43F4-9552-A0C302AA8C42}" Type="Lookup" Name="Category" DisplayName="Category" StaticName="Category" Group="*****" Required="TRUE" List="{c426affc-9a52-4eab-8c98-a0db60fccfb4}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-B0E3-4683-ADED-7EDA255F3EA9}" Type="Lookup" Name="PublishedLocation" DisplayName="Published Location" StaticName="PublishLocation" Group="*****" Required="TRUE" List="{7ef36598-5d0b-4fbd-a8ec-d6524474a786}" ShowField="Title" PrependId="True" />
<Field ID="{C1000005-6AFE-4DDE-BFE9-0A282C8730BA}" Type="User" Mult="TRUE" Name="Audience" BaseType="Text" Sealed="TRUE" ShowInDisplayForm="TRUE" ShowInEditForm="TRUE" ShowInNewForm="TRUE" ShowInListSettings="TRUE" DisplayName="Audience" Required="FALSE" Group="*****" />
</Elements>