Skip to content

Instantly share code, notes, and snippets.

public List<HtmlGenericControl> BindHtmlTags()
{
genericControl = new List<HtmlGenericControl>();
try
{
HtmlGenericControl dropdownDivTag = new HtmlGenericControl("input");
dropdownDivTag.Attributes.Add("ID", "search");
genericControl.Add(dropdownDivTag);
public List<HtmlGenericControl> ControlDefinitionJavascripts(string folderPathJs)
{
genericControl = new List<HtmlGenericControl>();
try
{
HtmlGenericControl jsLinkJquery = new HtmlGenericControl("script");
jsLinkJquery.Attributes.Add("type", "text/javascript");
jsLinkJquery.Attributes.Add("src", folderPathJs + "/jquery.min.js");
genericControl.Add(jsLinkJquery);
[ToolboxItemAttribute(false)]
public class CustomWebPart : Microsoft.SharePoint.WebPartPages.WebPart
{
// Visual Studio might automatically update this path when you change the Visual Web Part project item.
private const string _ascxPath = @"~/_CONTROLTEMPLATES/15/test/CustomControl.ascx";
private const string RelativeFolderCss = "../ReferencedFiles/css";
private const string RelativeFolderJs = "..ReferencedFiles/js";
protected override void CreateChildControls()
{