Popular Posts
Build an OpenVPN server on android device Preparation An android device, in this case, Sony xperia Z is used Root permission required Linux Deploy for deploy i... Enable SSL connection for Jsoup import org.jsoup.Connection; import org.jsoup.Jsoup; import javax.net.ssl.*; import java.io.IOException; import java.security.KeyManagement... Change the AppDomain's Base Directory and Environment Directory // Update AppDomain's Base Directory string root_path = "c:\\temp\\"; AppDomain.CurrentDomain.SetData("APPBASE", roo...
Stats
Custom webpart properties
AwardView.cs
[ToolboxItemAttribute(false)]
public class AwardView : WebPart
{
    [WebBrowsable(true)]
    [Category("Extended")]
    [WebDescription("Shows when items contains no photo")]
    [WebDisplayName("Substitute Photo")]
    [Personalizable(PersonalizationScope.Shared)]
    public string SubstitutePhoto { get; set; }

    // Visual Studio might automatically update this path when you change the Visual Web Part project item.
    private const string _ascxPath = @"~/_CONTROLTEMPLATES/QuarterlyAward/AwardView/AwardViewUserControl.ascx";

    protected override void CreateChildControls()
    {
        Control control = Page.LoadControl(_ascxPath);
        Controls.Add(control);
    }
}
AwardView.webpart (set default value)
<?xml version="1.0" encoding="utf-8"?>
<webParts>
  <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
    <metaData>
      <type name="QuarterlyAward.AwardView.AwardView, $SharePoint.Project.AssemblyFullName$" />
      <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
    </metaData>
    <data>
      <properties>
        <property name="Title" type="string">AwardView</property>
        <property name="Description" type="string">My Visual WebPart</property>
        <property name="SubstitutePhoto" type="string">/sites/BruceDev/SiteAssets/Personal.png</property>
      </properties>
    </data>
  </webPart>
</webParts>