2. About. Visual web part definition. How to create Visual web part. Visual web part - Namespace. Visual web part - Location. Visual web part - Public properties. Visual web part - Localization. Questions. Agenda 2
3. Development Manager - SURE My Blog: http://SharePoint4Arab.blogspot.com Learn SharePoint 2010 book – Author. SharePoint 2010 MCITP. Abouts 3
4. Inherits WebPart class System.Web.UI.WebControls.WebParts Use VS 2010 templates. Depends on ascx (UserControl). Easy to use. Visual web part 4
5. Visual Studio 2010 templates. SharePoint 2010 - Project template. SharePoint 2010 - Item template. How to create Visual web part 5
6. Open Visual Studio 2010 File New Project SharePoint – 2010 Visual Web Part template Project template (cont.) 6
7. Right click on SharePoint project. Add New Item Visual Web Part template. Item template (cont.) 7
8. Why? Code enhancement. web.config readable. How? Change web part namespace. Change user control namespace. Modify type element value in “*.webpart” file. Modify Namespace value in “SharePointProjectItem.spdata” file. Visual web part - namespace 8
9. Why? To organize your web part files. Visual web part Group Change <Property Name="Group" Value=“YOUR_GROUP" /> in Elements.xml file. Visual web part files location. Change _ascxPath value in web class. Change user control deployment target in “SharePointProjectItem.spdata” file. Visual web part - Location 9
10. Why? Configurable Visual web part. More flexibility. Add public property to web part class. Pass the value of public property to user control in CreateChildControls method. Visual web part - Public properties 10
11. Why? Support multi languages. How? Mapping to resources folder under 14 folder. Add resource files. Replace the text you want by resource expression. Visual web part - Localization 11