Create a new custom widget in Visual Studio
To create a custom widget and implement its logic, you must first create an empty custom widget in Visual Studio. Custom widgets are independent from the project, which they are being used in. They consist of a single .dll file, which can be reused across different applications. The new widget holds the logic and functionality of the custom widget.
To create an empty custom control, perform the following:
- From the context menu of Sitefinity's solution, click Add » New project...
- From the dialog choose Visual C# » Web » ASP.NET Server Control.
- Name the project and click OK.
A new project is generated under the solution. It contains only a single .cs file named ServerControl1.
NOTE: If you rename the .cs file, you also must rename the class name inside the file.
: If your Visual Studio version is newer than Visual Studio 2012, perform the following:
- In Visual Studio, open the context menu of the Telerik.Sitefinity solution and click Add » New Project...
- Select the Class Library (.Net Framework) template and click Next.
- Add reference to
using Telerik.Sitefinity.Web.UI on top of class.
For more information, see Inherit the built-in base class
You can now modify the auto-generated code beside the class definition.