Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Creation Of Web Part Page

  Asked By: Viral    Date: Aug 19    Category: Sharepoint    Views: 1020

It has been really nice posting queries on this site as the response is
really amazing.

So, i have one more question for you guys.

Is there a way to create a WebPart Page thru code(VB.NET) ?

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Gabrielle Welch     Answered On: Aug 19

This can be done through the Object Model using the
Microsoft.SharePoint.WebPartPages Namespace. Check the SDK for details.

 
Answer #2    Answered By: Janessa Riggs     Answered On: Aug 19

This is from a document I created for my company. I hope it comes
through in a readble format (cut and paste). Sorry for the
information overload. ...but what can I say? I'm lazy, so you get
everything.


Development
Pre-Development
1. Download and register Microsoft.Sharepoint.dll into the GAC
2. Download and install the wsssdk.exe
3. Download and install Lutz Roeder's .Net Reflector program.

Development Steps
1. Using Visual Studio.Net, create  a new SharePoint web  Part
Project (wssSDK should have added this option to your Visual Studio
Project Manager.
2. Include reference to Microsoft.sharepoint.dll
3. Using the sn.exe command line utility create a KeyPair.snk
file
4. Include a CAB project into your web part  solution
a. Include Primary Output
b. Include Content Files
c. Include KeyPair.snk
d. Include other files (e.g. resX , gifs , etc)
Note: make sure that the CAB project is a dependent of the web part
project
5. Edit the AssemblyInfo.cs class, change AssemblyVersion
("1.0.0.1")
6. Use Lutz Roeder's .Net Reflector to get the PublicKeyToken ID
7. Edit the DWP file to include assembly information (e.g.
<Assembly>MyWebPartProjectName, Version=1.0.0.1, Culture=neutral,
PublicKeyToken=d2d0ae92999983bd</Assembly>
a. The Assembly name [MyWebPartProjectName] is case sensitive
and MUST match the compiled dll name exactly.
b. The entire contents of the <Assembly> tags can be copied and
pasted from the .Net Reflector program
8. The version number in the dwp file MUST match the version in
the AssemblyInfo.cs file exactly.

Development Notes
1. All public properties will be serialized and be part of the
tool parts property pages.
2. Public properties should be of the following types: String,
Enumeration, Boolean, Date or Numeric.
Property Type Displays as
String Text Box
Date Text Box
Numeric Text Box
Boolean Check Box
Enumeration Drop Down List



3. Each public property should have the following attributes:
Attribute Name Attribute Resultant
Browsable(<true/false>) - Displays the property in the tool pane
(true or false)
Category(<Text Value>) - Determines which category this property
will appear under.
- If no category is provided, Miscellaneous will be used
- If the entry matches categories that already exist (Advanced,
Layout, etc), the entry will be ignored and Miscellaneous will be
used.
DefaultValue(<variable>) - Required for proper initialization
WebPartStorage
(<storage enum value>) - Determines who sets the value (shared is
set by admin, personal is set by user)
FriendlyName(<Text Value>) - This is the title of the property
and it will show up as a label on the tool property pane.
Description(<Text Value>) - This is the information that will
display in the tool tip dialog

4. Each property should be dependent on two defined variables.
The first is a constant which defines the default value (<private
const string defaultVarValue>). The second is the variable that will
store the value of the data entered (<private string varValue>).


Web Part Installation

1. Copy the recently compiled CAB project to a directory on the
SharePoint web server (must be placed on both production web servers).
a. We are currently storing all of the CAB projects in the
following directory:
\\hqsppweb\Program Files\Common Files\Microsoft Shared\web server
extensions\60\WPPACKS

2. Installing the web part can be as easy as right-clicking the
CAB project and "Install Web Part", or by using the stsadm.exe program
3. Using the command line utility stsadm.exe found at:
C:\Program Files\Common Files\Microsoft Shared\web server
extensions\60\BIN perform the following commands
a. Add Web Part: stsadm -o addwppack -globalinstall -force -
filename C:\<path>\<Cab Project Name>.CAB
b. Delete Web Part: stsadm -o deletewppack -name <Cab Project
Name>.CAB





Additional Links that may help:

Testing Checklist
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/odc_SP2003_ta/html/Office_SharePointWebPartsTestingChecklist.asp

SharePoint Developer to Developer
http://msd2d.com/

Introduction to Web Parts
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/odc_SP2003_ta/html/sharepoint_modifyingui.asp

Building a Basic Web Part
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/spptsdk/html/CreateWPToolPart_SV01003711.asp

Web Part Design Considerations
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/modcore/html/deconguidelinesforbuildinggoodwebparts.asp

Advanced Web Part Design
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/odc_SP2003_ta/html/sharepoint_modifyingui.asp

Deploying Web Parts
msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-" target="_blank" rel="nofollow">msdn.microsoft.com/.../en-
us/odc_SP2003_ta/html/sharepoint_deployingwebparts.asp

 
Didn't find what you were looking for? Find more on Creation Of Web Part Page Or get search suggestion and latest updates.




Tagged: