Step 2 :- We need to register the compiled assembly in GAC and provide the token value in the ‘Feature.XML’ file. You need to use GACUTIL to register. You can get the token by browsing to ‘c:\Windows\Assembly’ and then viewing the properties of the assembly.
Step 3:- Copy the two XML file i.e. ‘Feature.xml’ and ‘ElementManisfest.xml’ in the ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\DisplayCustomPage’ directory.
Step 4:- Now we need to install the feature using STSADM.exe. So go to dos prompt à and go to ‘C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN’ directory.
>cd C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
To install the feature run the below command using ‘STSADM’. Please note that you need to specify the relative directory path and not the physical path of ‘Feature.xml’ file.
>stsadm -o installfeature -filename DisplayCustomPage\Feature.xml
To ensure that SharePoint registers about this feature run IISRESET on the machine.
Step 5:- Now click on the Site Action à Site Settings à Site Features and Activate the feature.
Now you can see your feature enabled in the site actions menu. If you click on the feature i.e ‘Display Custom Pages’ it will redirect you to ‘SimplePageCodeBehind.aspx’.
The other point to be noted is that the events have fired and set the title and description as described in the code.
Try to experiment and deactivate the feature and you will see the title and description changing.
Asked In: Many Interviews |