Deploying the Web Part
1.Copy the user control file (*.ascx) in the path- “SharePoint Installation Drive\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATE/usercontrolfilename.ascx”
2.Copy the DLL of the user control in the path-“SharePoint Installation Drive\Inetpub\wwwroot\wss\VirtualDirectories\[Site Port No.]\bin\”
3.Create Strong name key.
a.Right click on the web part project, go to “properties”
b.Select “signing” tab from left side
c.Check the “Sign the assembly” checkbox
d.Select “New” from the below drop down. ”Create Strong Name Key” Window opens.
e.Uncheck the “Protect my Keyfile with a password”, enter name in the “Key File Name” textbox, then click “ok”.
Check the below screen for reference:

4.Drag and drop the web part DLL in GAC (Type “assembly” in Start -> Run to open the Assembly folder directly).
5.Add Safe Control tag in the web.config file of this path- SharePoint Installation Drive\Inetpub\wwwroot\wss\VirtualDirectories\[Site Port No.]\web.config

Collapse | Copy Code
Note
Get the Public Key Token value in two ways:

1.From the Assembly folder, right click on the DLL (or deployed assembly) and go to properties and copy the Public Key Token value.
2.Use Lutz Reflector. Helps in getting more information about .NET assemblies. Download from here.

6.Do iisreset.
Adding the Web part in the Web Part Gallery
1.Navigate to the site URL – http://%5BSite Port No.]
2.Go to Site Actions>> Site Settings>>Galleries>>Webparts>>Web Part Gallery
3.Click on “New” button of “Web parts Gallery” page. ”Web Part Gallery: New Web Parts” page gets opened, Select the deployed web part from the list below and click on “Populate Gallery” button
4.If web part already exists, check the “Overwrite if file already exists” checkbox and click on “Populate Gallery” button
Using the Web Part in the Site Home Page
1.Navigate to the Site Home Page
2.Go to Site Actions>>Edit Page
3.Click on “Add a Web Part” and the opened window contains the list of all web parts
4.Under Miscellaneous section, select the previously deployed web part and then click on “Add” button.
5.Click Exit Edit mode
Now the Gridview webpart is displayed with Paging, sorting and CheckAll and UnCheckAll options are displayed.

Debugging the Web Part
1.Start>> Run>> Type cmd
2.Type “cd\” in the command prompt window, then type IISAPP.vbs and press enter type IISAPP.vbs is used to get the Process ID of SharePoint site.
(Refer the below screen shot, in this case the process ID is 2784.)

3.In Visual Studio go to Debug>> Attach to Process >> and check for the Process “w3wp.exe” and Process ID 2784.
4.Select the process and click on “Attach” button.

5.Add breakpoints in the application and debug the web part like any other .NET project.

——-

Installing features and adding breadcrumbs to custom web pages in SharePoint Central Administration
Steps to be followed:

Creating and installing features in Central Administration.
Creating and placing custom web pages in Central Administration.
Adding breadcrumbs to above custom web pages in Central Administration.

Create Feature.xml and CustomBreadCrumbs.xml
Create folder (CACAdminPages) in [Installation Drive]/Program files/Common Files/Microsoft Shared/web server extensions/12/Template/Features/
Create Feature.xml and CustomBreadCrumbs.xml in [Installation Drive]/Program files/Common Files/Microsoft Shared/web server extensions/12/Template/Features/ CACAdminPages

Install the feature.xml file in order to make the hyperlinks appear as shown in the above image. Navigate to [Sharepoint Installation Drive]\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN in Visual Studio Command Prompt and then execute the below command to install the feature.
Stsadm -o installfeature -name [folder name] { which we have created to place the

Download the attached web application and build the solution.
Copy the web application dll and paste it in the below path – [Sharepoint Installation Drive] / Inetpub/wwwroot/ WSS /VirtualDirectories/ [AdminPortNo.]/bin
Create a folder (CACAdminPages) in [Sharepoint Installation Drive]/Program files/Common Files/Microsoft Shared/Webserverextensions/12/Template/ Admin

NOTE: Use the same folder name in the Url property of the UrlAction tag of the “CustomBreadCrumbs.xml”.
Copy all five aspx pages from the downloaded web application and paste them in CACAdminPages folder.

Add the sharepoint master pages in all five aspx pages.

Create an xml file as “admin.sitemap.*.xml” (naming convention should be followed, replace “*” with some name. Eg: admin.sitemap.custombreadcrumb.xml) with the below structure in the path-
[Sharpoint Installation Drive]\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\ADMIN

admin.sitemap.custombreadcrumb.xml:

Execute the following command in the Visual Studio Command prompt to merge this newly created sitemap file with the existing admin.sitemap file.

stsadm -o appbincontent

Advertisements

About ambatisreedhar

Developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s