I've created a Sharepoint 2010 Visual Webpart in Visual Studio 2012. The structure of the template that it generates is slightly different than in VS 2010. Previously, it would create the Webpart class and a user control. In 2012 that is all combined into a single class file.
However, I've yet to be successfully add any properties to the webpart. It deploys and compiles. But properties aren't showing up in the user interface when you edit the webpart. I've defined it as below:
private string _myString;
[Category("Custom Properties")]
[DefaultValue("test123")]
[Browsable(true)]
[WebPartStorage(Storage.Personal)]
[FriendlyNameAttribute("Custom String")]
[Description("Type a string value.")]
[XmlElement(ElementName = "MyString1231123")]
public string MyString
{
get
{
return _myString;
}
set
{
_myString = value;
}
}
Any issues?
I did notice that the template that vs2012 generates uses a System.Web.UI.WebControls.WebPArts.Webpart based class, not a sharepoint one.