我有一個自定義Web部件,它的XSL鏈接屬性將它連接到運行Web部件的XSLT文件。我想要創建另一個布爾字段,當選中時,Web部件將鏈接到另一個XSLT文件。我不能使用get/set方法,因爲這不是標準的Web部件。我沒有推動這個Web部件的C#頁面。我確實有.webpart文件,它具有屬性的所有值,我認爲這是我需要放置代碼的地方。我只是不確定如何做到這一點。任何幫助將非常感激。這是.webpart文件的一部分:如何在DataFormWebPart中創建自定義屬性
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.DataFormWebPart, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="PageSize" type="int">-1</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="Height" type="string" />
<property name="SampleData" type="string" null="true" />
<property name="AllowConnect" type="bool">True</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="XslLink" type="string">/home/appbar.xslt</property>
<property name="AllowClose" type="bool">True</property>
<property name="Hidden" type="bool">False</property>
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="TitleIconImageUrl" type="string" />
<property name="ChromeState" type="chromestate">Normal</property>
<property name="FireInitialRow" type="bool">True</property>
<property name="Description" type="string" />
<property name="AllowMinimize" type="bool">True</property>
<property name="Xsl" type="string" null="true" />
<property name="ExportMode" type="exportmode">All</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="Default" type="string" />
<property name="UseSQLDataSourcePaging" type="bool">True</property>
<property name="ParameterBindings" type="string">
<ParameterBinding Name="ListName" Location="None" DefaultValue="MDocLinks"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</property>
<property name="DisplayName" type="string" />
<property name="NoDefaultStyle" type="string">TRUE</property>
<property name="Title" type="string">MDock</property>
<property name="AllowHide" type="bool">True</property>
<property name="ViewFlag" type="string">0</property>
</properties>
</data>
</webPart>
</webParts>
這是它的大部分。我不想填滿太多頁面。 :)