2011-08-09 10 views
0

웹 파트를 실행하는 XSLT 파일에 연결하는 XSL 연결 속성이있는 사용자 지정 웹 파트가 있습니다. 내가 선택하면 웹 파트가 다른 XSLT 파일에 링크되는 다른 부울 필드를 만들고 싶습니다. 표준 웹 파트가 아니기 때문에 get/set 메서드를 사용할 수 없습니다. 이 웹 파트를 구동하는 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"> 
        &lt;ParameterBinding Name="ListName" Location="None" DefaultValue="MDocLinks"/&gt; 
        &lt;ParameterBinding Name="dvt_apos" Location="Postback;Connection"/&gt; 
        &lt;ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/&gt; 
        &lt;ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/&gt; 
       </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> 

이것은 대부분입니다. 나는 너무 많은 페이지를 채우고 싶지 않았다. :)

답변

1

.webpart는 단순히 웹 파트에 대한 정의입니다. 백엔드 코드는 이미 어떤 어셈블리/클래스가 처리를 담당하는지 정의하는 것입니다.

당신이 말하는 것을 달성하기 위해서는 DataFormWebPart에서 상속받은 Visual Studio에서 새로운 웹 파트를 만들어야합니다.

그런 다음 추가 속성 및 조건부 조회 논리를 추가 할 수 있습니다.

관련 문제