Не догоняю пример из книги: Open the EmployeeList.cs and add a property called DBConnectionString with attributes as follows:
| Код | Personalizable(PersonalizationScope.Shared), WebBrowsable, Category("DB Connection"), WebDisplayName("DB Connection String"), WebDescription("DB Connection string.")] public string DBConnectionString { get; set; }
|
Вот EmployeeList.cs:| Код |
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 EmployeeList.EmployeeList { [ToolboxItemAttribute(false)] public class EmployeeList : WebPart { // Visual Studio might automatically update this path when you change the Visual Web Part project item. private const string _ascxPath = @"~/_CONTROLTEMPLATES/EmployeeList/EmployeeList/EmployeeListUserControl.ascx";
protected override void CreateChildControls() { Control control = Page.LoadControl(_ascxPath); Controls.Add(control); } } }
|
Понимаю, что свойство класса, но куда атрибуты-то? |