Tuesday, December 23, 2008

Creating Web Parts Using Sharepoint 2005 !!

Open visual studio .net 2005

Select Web Parts template

Do some codes under override render control sub procedure

Make sure the setting of the dll were placed under the /wwwroot/xxx/bin so the compiled dll will directly being placed under site bin directory

Open the property of the project and under signing create a strong name key for that project. Otherwise using the .Net 2005 command prompt type sn.exe –k <.snk> to create the strong name key of the project manually. Make sure the strong name key is referenced under assembly file of that project

After the code is done, then compile the project. Make sure that there is no error and check the existence of the dll under the bin directory in the wwwroot.

Then to the dll must be put under the global assembly cache. Using the .net command prompt just type gacutil –i <.dll>. This to make the web parts is full trusted by the application.

Then open the administrative tools> Microsoft .net 2.0 configuration> Assembly cache. Make sure that the assembly is exists in the GAC.

Then using the command prompt again, type the sn.exe –Tp <.dll> to retrieve token key number.

Open the web.config of the site application, and then add new safe control accordingly to the dll. Don’t forget to paste the token key in creating the safe control.

Then the web parts is ready to be used by sharepoint. Find the webpart name as <.webparts>

The web parts seems to appeare without no error, but when i compiled the dll again the webparts does not updated. Huhu .. very ponin kepala.

But the cleare picture of what is going on the sharepoint are more clear right now. From day to day a new thing comes in. Huhu, RND.

0 Orang budak itam: