13 Nisan 2010 Salı

Sharepoint 2010 Code Behind Assembly

Sharepoint'te custom oluşturulan sayfa yada user controllerin code behind dosyaları aynı projede olabileceği gibi farklı bir dll 'den de gelebilir.

Page'in aspx'inde yada user control'ün ascx'inde code behind tanımlası yapılırken

CodeBehind="XXX.aspx.cs" Inherits="XX Kod Dosyası" tanımlamasında XX Kod Dosyası


1- aynı projede ise aspx yada ascx'in en üst satırına


<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>


tanımlaması yapmak yeterli olacaktır.


2- farklı class lib de ise


   1. Create the Code-Behind Assembly
   2. Deploy the Code-Behind Assembly
   3. Reference the Assembly in your SharePoint Page
   4. Tell SharePoint that it is safe to use the assembly


(Kaynak: http://johanolivier.blogspot.com/2010/01/sharepoint-code-behind-tutorial.html)


 

Hiç yorum yok: