Replace CustomPropertiesVisualWP.cs file
with the following code.
using
System;
using
System.ComponentModel;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
Microsoft.SharePoint;
using
Microsoft.SharePoint.WebControls;
namespace
CustomProperties.CustomPropertiesVisualWP
{
[ToolboxItemAttribute(false)]
public class
CustomPropertiesVisualWP :
WebPart
{
public
static string _value;
[System.Web.UI.WebControls.WebParts.WebBrowsable(true),
System.Web.UI.WebControls.WebParts.WebDisplayName("Enter
the Value"),
System.Web.UI.WebControls.WebParts.WebDescription(""),
System.Web.UI.WebControls.WebParts.Personalizable(
System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared),
System.ComponentModel.Category("anavijai
Custom Properties"),|
System.ComponentModel.DefaultValue("")]
public
string _Value
{
get {
return _value; }
set { _value =
value; }
}
// Visual Studio might automatically
update this path when you change the Visual Web Part project item.
private
const string
_ascxPath = @"~/_CONTROLTEMPLATES/CustomProperties/CustomPropertiesVisualWP/CustomPropertiesVisualWPUserControl.ascx";
protected
override void CreateChildControls()
{
Control control =
Page.LoadControl(_ascxPath);
Controls.Add(control);
}
}
}