Skip to Content
Essential SharePoint
book

Essential SharePoint

by Jeff Webb
May 2005
Beginner
336 pages
10h 14m
English
O'Reilly Media, Inc.
Content preview from Essential SharePoint

Adding Properties

The default web part template comes with a Text property. That property appears at the bottom of the property task pane in the Miscellaneous category if you display the web part page in a personal view and then select Modify My Web Part, as shown in Figure 9-11.

Displaying the custom Text property that comes with the web part template

Figure 9-11. Displaying the custom Text property that comes with the web part template

The provided Text property is really only intended as a basic starting point for your own properties. Starting from Text, the most common next steps are:

  1. Change the property storage from personal to Shared. Shared properties are available to everyone who views the page.

  2. Serialize the property so that changes in the task pane are reflected in the web part.

  3. Link the property setting to the value of a child control on the web part. That allows members to change the property and see the effects of the change.

  4. Save the property to the content database; otherwise, changes are lost when the member navigates away from the page.

The following code illustrates these changes by extending the template code to create a simple web part with a textbox and a Save button. The textbox is linked to the Text property, so if the member clicks Save, the property is preserved the next time the page is viewed:

 Private Const _defaultText As String = "" Dim _text As String = _defaultText   ' 1) Change storage to WebPartStorage(Storage.Shared). ' and ' ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

SharePoint User's Guide

SharePoint User's Guide

Infusion Development Corp. (Infusion Development Corporation)
SharePoint 2016 For Dummies

SharePoint 2016 For Dummies

Ken Withee, Rosemarie Withee
Microsoft SharePoint 2016 Step by Step

Microsoft SharePoint 2016 Step by Step

Olga Londer, Penelope Coventry

Publisher Resources

ISBN: 0596008805Errata Page