本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlGenericControl类的典型用法代码示例。如果您正苦于以下问题:C# HtmlGenericControl类的具体用法?C# HtmlGenericControl怎么用?C# HtmlGenericControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlGenericControl类属于System.Web.UI.HtmlControls命名空间,在下文中一共展示了HtmlGenericControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AddSalesTypeField
private void AddSalesTypeField(HtmlGenericControl container)
{
using (HtmlGenericControl salesTypeDiv = HtmlControlHelper.GetField())
{
salesTypeDiv.ID = "SalesTypeDiv";
salesTypeDiv.Attributes.Add("style", "width:200px");
using (HtmlGenericControl field = HtmlControlHelper.GetField())
{
using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.SalesType, "SalesTypeSelect"))
{
field.Controls.Add(label);
}
using (HtmlSelect salesTypeSelect = new HtmlSelect())
{
salesTypeSelect.ID = "SalesTypeSelect";
salesTypeSelect.DataSource = this.GetSalesTypes();
salesTypeSelect.DataTextField = "Text";
salesTypeSelect.DataValueField = "Value";
salesTypeSelect.DataBind();
field.Controls.Add(salesTypeSelect);
}
salesTypeDiv.Controls.Add(field);
}
container.Controls.Add(salesTypeDiv);
}
}
开发者ID:abinabrahamanchery,项目名称:mixerp,代码行数:31,代码来源:SalesType.cs
示例2: GetAdministrateControls
/// <summary>
/// Adds icons to the configuration area of a block instance. Can be overridden to
/// add additionsl icons
/// </summary>
/// <param name="canConfig"></param>
/// <param name="canEdit"></param>
/// <returns></returns>
public override List<Control> GetAdministrateControls( bool canConfig, bool canEdit )
{
List<Control> configControls = new List<Control>();
// add edit icon to config controls if user has edit permission
if ( canConfig || canEdit )
{
LinkButton lbEdit = new LinkButton();
lbEdit.CssClass = "edit";
lbEdit.ToolTip = "Edit HTML";
lbEdit.Click += lbEdit_Click;
configControls.Add( lbEdit );
HtmlGenericControl iEdit = new HtmlGenericControl( "i" );
lbEdit.Controls.Add( iEdit );
lbEdit.CausesValidation = false;
iEdit.Attributes.Add( "class", "fa fa-pencil-square-o" );
// will toggle the block config so they are no longer showing
lbEdit.Attributes["onclick"] = "Rock.admin.pageAdmin.showBlockConfig()";
ScriptManager.GetCurrent( this.Page ).RegisterAsyncPostBackControl( lbEdit );
}
configControls.AddRange( base.GetAdministrateControls( canConfig, canEdit ) );
return configControls;
}
开发者ID:pkdevbox,项目名称:Rock,代码行数:34,代码来源:HtmlContentDetail.ascx.cs
示例3: CreateChildControls
protected override void CreateChildControls()
{
var root = new HtmlGenericControl("div");
root.ID = "_ParentDiv";
root.Attributes.Add("style", "border-style:solid; border-width:1px;");
Controls.Add(root);
}
开发者ID:CharlieBP,项目名称:AjaxControlToolkit,代码行数:7,代码来源:ChartBase.cs
示例4: createTable
private HtmlGenericControl createTable(string tableName, string[] keys, string[] values)
{
HtmlGenericControl tableGeneral = new HtmlGenericControl("table");
tableGeneral.Attributes["cellspacing"] = "0";
HtmlGenericControl tableRow = new HtmlGenericControl("tr");
tableRow.Attributes["class"] = "tableTitle";
HtmlGenericControl tableHeader = new HtmlGenericControl("th");
tableHeader.Attributes["colspan"] = "2";
tableHeader.InnerText = tableName;
tableRow.Controls.Add(tableHeader);
tableGeneral.Controls.Add(tableRow);
HtmlGenericControl tr = new HtmlGenericControl("tr");
HtmlGenericControl tdKey = new HtmlGenericControl("td");
HtmlGenericControl tdValue = new HtmlGenericControl("td");
for (int i = 0; i < keys.Length; i++)
{
tr = new HtmlGenericControl("tr");
tdKey = new HtmlGenericControl("td");
tdValue = new HtmlGenericControl("td");
tdKey.InnerText = keys[i];
tdValue.InnerText = values[i];
tr.Controls.Add(tdKey);
tr.Controls.Add(tdValue);
tableGeneral.Controls.Add(tr);
}
return tableGeneral;
}
开发者ID:encode481,项目名称:CourseWorkPSP,代码行数:32,代码来源:Device.aspx.cs
示例5: AddJavaScriptInclude
/// <summary>
/// файл javascript в header
/// </summary>
public static void AddJavaScriptInclude(string url, Page page)
{
var script = new HtmlGenericControl("script");
script.Attributes["type"] = "text/javascript";
script.Attributes["src"] = url;
page.Header.Controls.Add(script);
}
开发者ID:blade-runner,项目名称:rutokenweb.asp.net,代码行数:10,代码来源:Utils.cs
示例6: CreateNewOptionsToMenuForNavigation
/// <summary>
///
/// </summary>
/// <param name="iChildrenCount"></param>
/// <param name="userLoginName"></param>
/// <param name="ChildrenNodes"></param>
/// <param name="htmlul"></param>
private void CreateNewOptionsToMenuForNavigation(ref Int64 iChildrenCount, string userLoginName, SPNavigationNodeCollection ChildrenNodes,ref HtmlGenericControl htmlul)
{
try
{
HtmlGenericControl htmlh2SubGroup = new HtmlGenericControl("h2");
HtmlGenericControl htmlliSubGroup = new HtmlGenericControl("li");
htmlliSubGroup.Attributes.Add("class", "heading");
htmlh2SubGroup.Controls.Add(CreateAnchor("", ChildrenNodes.Parent.Title, "", "parent"));
htmlliSubGroup.Controls.Add(htmlh2SubGroup);
htmlul.Attributes.Add("class", "simple");
htmlul.Controls.Add(htmlliSubGroup);
foreach (SPNavigationNode node in ChildrenNodes)
{
if (clsCommonBL.IsUserHasAccess(node.Url, userLoginName))
{
HtmlGenericControl htmlli = new HtmlGenericControl("li");
HtmlAnchor htmlAnchor = new HtmlAnchor();
htmlli.Controls.AddAt(0, CreateAnchor(node.Url, node.Title,node.Title, string.Empty));
////Children Count
++iChildrenCount;
htmlul.Controls.Add(htmlli);
}
}
}
catch (Exception ex)
{
throw;
}
}
开发者ID:hmendezm,项目名称:SP.GlobalTopMenuAndFooter,代码行数:42,代码来源:ucGlobalNav.ascx.cs
示例7: CreateChildControls
protected override void CreateChildControls()
{
Table table = new Table();
for (int i = 0; i < _colors.Length; i++)
{
TableRow row = new TableRow();
table.Rows.Add(row);
for (int j = 0; j < _colors[i].Length; j++)
{
TableCell cell = new TableCell();
cell.Style[HtmlTextWriterStyle.Width] = "10px";
cell.Style[HtmlTextWriterStyle.Height] = "10px";
cell.Style[HtmlTextWriterStyle.Cursor] = "pointer";
cell.Style["background-color"] = "#" + _colors[i][j];
cell.Attributes.Add("onclick", "setColor(\"#" + _colors[i][j] + "\")");
row.Cells.Add(cell);
HtmlGenericControl innerDiv = new HtmlGenericControl("div");
innerDiv.Style[HtmlTextWriterStyle.Height] = "100%";
innerDiv.Style[HtmlTextWriterStyle.Width] = "100%";
innerDiv.Style["font-size"] = "1px";
cell.Controls.Add(innerDiv);
}
}
table.Attributes.Add("border", "0");
table.Attributes.Add("cellspacing", "1");
table.Attributes.Add("cellpadding", "0");
table.Style["background-color"] = "#000000";
Content.Add(table);
base.CreateChildControls();
}
开发者ID:sumutcan,项目名称:WTWP-Ticket-Booking,代码行数:33,代码来源:BaseColorsPopup.cs
示例8: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
const string METHOD_NAME = "Page_Load";
try {
Common.AppHelper.HideWarning(divWarning);
// This is really GREAT !!!
HtmlGenericControl script = new HtmlGenericControl("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("src", Page.ResolveUrl("~/Script/Common.js"));
Page.Header.Controls.Add(script);
System.Collections.Specialized.NameValueCollection nv = Page.Request.QueryString;
MasterControlName.Text = nv["MasterControlName"];
ActionControlName.Text = nv["ActionControlName"];
Action.Text = nv["Action"];
lblTextEntryLabel.Text = nv["Label"];
string clickCtrl = (nv["clickCtrlName"] != null ? nv["clickCtrlName"].ToString() : "");
btnOk.Attributes.Add("onclick", "DoOk('" + clickCtrl + "');");
}
catch (System.Exception ex) {
Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
((PrimaryTemplate)Page.Master).ShowWarning(ex);
}
}
开发者ID:jwebb-vtg,项目名称:WSCIEMP,代码行数:29,代码来源:TextEntry.aspx.cs
示例9: CreateChildControls
/// <summary>
/// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
/// </summary>
protected override void CreateChildControls()
{
base.CreateChildControls();
base.Controls.Clear();
_dfltShowButton = new Button();
base.Controls.Add(_dfltShowButton);
_dfltShowButton.ID = "default";
_dfltShowButton.Attributes.Add("style","display:none");
_dialogPanel = new Panel();
base.Controls.Add( _dialogPanel );
_dialogPanel.ID = "panel";
_dialogPanel.CssClass = "rock-modal-frame";
_dialogPanel.Attributes.Add("style","display:none");
_contentPanel = new Panel();
_dialogPanel.Controls.Add( _contentPanel );
_contentPanel.ID = "contentPanel";
_contentPanel.CssClass = "iframe";
_iFrame = new HtmlGenericControl( "iframe" );
_iFrame.ID = "iframe";
_iFrame.Attributes.Add( "scrolling", "no" );
_contentPanel.Controls.Add( _iFrame );
this.PopupControlID = _dialogPanel.ID;
}
开发者ID:Ganon11,项目名称:Rock,代码行数:31,代码来源:ModalIFrameDialog.cs
示例10: AddCompactCheckBoxField
private void AddCompactCheckBoxField(HtmlGenericControl container)
{
using (HtmlGenericControl field = HtmlControlHelper.GetField())
{
using (HtmlGenericControl slider = new HtmlGenericControl("div"))
{
slider.Attributes.Add("class", "ui checkbox");
using (HtmlInputCheckBox checkBox = new HtmlInputCheckBox())
{
checkBox.ID = "CompactCheckBox";
checkBox.Checked = false;
slider.Controls.Add(checkBox);
this.isCompactHidden = new HiddenField();
this.isCompactHidden.ID = "IsCompactHidden";
this.isCompactHidden.Value = "0";
slider.Controls.Add(this.isCompactHidden);
}
using (HtmlGenericControl label = HtmlControlHelper.GetLabel(Titles.ShowCompact))
{
slider.Controls.Add(label);
}
field.Controls.Add(slider);
}
container.Controls.Add(field);
}
}
开发者ID:roczj,项目名称:mixerp,代码行数:32,代码来源:ProfitAndLossAccount.ascx.cs
示例11: btnSubmit_Click
protected void btnSubmit_Click(object sender, EventArgs e)
{
string firstNameInput = tbFirstName.Text;
string lastNameInput = tbLastName.Text;
string facultyNumberInput = tbFacultyNumber.Text;
string universitySelection = ddlUniversity.SelectedValue;
string specialtySelection = ddlSpecialty.SelectedValue;
string coursesSelection = ddlCourses.SelectedValue;
var nameHeader = new HtmlGenericControl("h3");
nameHeader.InnerText = String.Format("Name: {0}", System.Web.HttpUtility.HtmlEncode(firstNameInput + " " + lastNameInput));
var facultyNumberHeader = new HtmlGenericControl("h4");
facultyNumberHeader.InnerText = String.Format("Faculty: {0}", System.Web.HttpUtility.HtmlEncode(facultyNumberInput));
var universityHeader = new HtmlGenericControl("h4");
universityHeader.InnerText = String.Format("University: {0}", universitySelection);
var specialtyHeader = new HtmlGenericControl("h4");
specialtyHeader.InnerText = String.Format("Specialty: {0}", specialtySelection);
var coursesHeader = new HtmlGenericControl("h4");
coursesHeader.InnerText = String.Format("Courses: {0}", coursesSelection);
registrationBox.Visible = false;
submittedForm.Controls.Add(nameHeader);
submittedForm.Controls.Add(facultyNumberHeader);
submittedForm.Controls.Add(universityHeader);
submittedForm.Controls.Add(specialtyHeader);
submittedForm.Controls.Add(coursesHeader);
}
开发者ID:BorislavIvanov,项目名称:Telerik_Academy,代码行数:32,代码来源:RegistrationPage.aspx.cs
示例12: AddAttachmentAnchor
private void AddAttachmentAnchor(HtmlGenericControl h)
{
if (this.DisplayAttachmentButton)
{
if (this.GetTranId().Equals("0"))
{
return;
}
if (string.IsNullOrWhiteSpace(this.AttachmentBookName))
{
return;
}
string overridePath = this.OverridePath;
if (string.IsNullOrWhiteSpace(overridePath))
{
overridePath = PageUtility.GetCurrentPageUrl(this.Page);
}
string attachmentUrl = string.Format(CultureInfo.InvariantCulture, "~/Modules/BackOffice/AttachmentManager.mix?OverridePath={0}&Book={1}&Id={2}", overridePath, this.AttachmentBookName, this.GetTranId());
using (HtmlAnchor anchor = new HtmlAnchor())
{
anchor.ID = "AttachmentAnchor";
anchor.InnerHtml = "<i class='icon cloud upload'></i>" + Titles.UploadAttachmentsForThisTransaction;
anchor.Attributes.Add("class", "item");
anchor.HRef = attachmentUrl;
h.Controls.Add(anchor);
}
}
}
开发者ID:roczj,项目名称:mixerp,代码行数:34,代码来源:Buttons.cs
示例13: CreateRotatorNavigationButtons
private void CreateRotatorNavigationButtons(Panel panel, HtmlGenericControl div, int divIndex)
{
panel.Controls.Clear();
double pages = div.Controls[0].Controls[0].Controls.Count / 6.0; //6 is the number of columns
pages = Math.Ceiling(pages);
div.Style["Width"] = (pages * 738) + "px";
if (pages > 1)
{
LinkButton linkButton = CreatePreviousButton(divIndex);
panel.Controls.Add(linkButton);
}
for (int i = 1; i <= pages; i++)
{
LinkButton linkButton = CreateLinkButton(i, divIndex);
panel.Controls.Add(linkButton);
}
if (pages > 1)
{
LinkButton linkButton = CreateNextButton(divIndex);
panel.Controls.Add(linkButton);
}
}
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:27,代码来源:ExpandedSearchPage.cs
示例14: LoadResults
public void LoadResults(
DataTable dataSource,
Panel panel,
HtmlGenericControl div,
Panel tileResultsPanel,
Panel gridResultsPanel,
RadGrid grid,
string resultType,
string contentTemplate)
{
if (resultType == "Grid")
{
grid.DataSource = dataSource;
grid.DataBind();
tileResultsPanel.Visible = false;
gridResultsPanel.Visible = true;
}
else
{
var resultsControl = new Controls.DynamicTileContainer(4, 113, 525, false);
resultsControl.DataSource = null;
resultsControl.ContentTileTemplate = contentTemplate;
resultsControl.DataSource = dataSource;
resultsControl.DataBind();
tileResultsPanel.Visible = true;
gridResultsPanel.Visible = false;
div.Controls.Clear();
div.Controls.Add(resultsControl);
AddNavigationButtons(panel, div);
}
}
开发者ID:ezimaxtechnologies,项目名称:ASP.Net,代码行数:35,代码来源:ExpandedSearchPage.cs
示例15: AddActions
private void AddActions(HtmlGenericControl container)
{
using (HtmlGenericControl actions = new HtmlGenericControl("div"))
{
actions.Attributes.Add("class", "actions");
using (HtmlGenericControl buttons = new HtmlGenericControl("div"))
{
buttons.Attributes.Add("class", "ui buttons");
using (HtmlInputButton cancelButton = new HtmlInputButton())
{
cancelButton.Attributes.Add("class", "ui red button");
cancelButton.Value = Titles.Cancel;
buttons.Controls.Add(cancelButton);
}
using (HtmlInputButton verifyButton = new HtmlInputButton())
{
verifyButton.ID = "VerifyButton";
verifyButton.Attributes.Add("class", "ui green button");
verifyButton.Value = Titles.Verify;
verifyButton.Attributes.Add("title", "CTRL + RETURN");
buttons.Controls.Add(verifyButton);
}
actions.Controls.Add(buttons);
}
container.Controls.Add(actions);
}
}
开发者ID:roczj,项目名称:mixerp,代码行数:33,代码来源:VoucherVerification.ascx.cs
示例16: AddFilterSelectorControls
private void AddFilterSelectorControls()
{
var container = new HtmlGenericControl("div");
container.Attributes.Add("class", "page-type-filter-container");
container.Controls.Add(new Label
{
Text = _translator.Translate("/PageTypeTreeFilter/PageExplorerAdapter/FilterSelectorLabel")
});
var pageTypeSelector = new PageTypeSelector
{
ID = "PageTypeSelector",
CssClass = "ContextMenuDropDown",
DataValueField = "Value",
DataTextField = "Text",
AutoPostBack = true
};
container.Controls.Add(pageTypeSelector);
pageTypeSelector.DataBind();
if (_roleStrategy.IsAdministrator())
{
container.Controls.Add(GlobalSettingsLink());
}
Control.Controls.AddAt(0, container);
}
开发者ID:kirolosgerges,项目名称:Blog,代码行数:28,代码来源:PageExplorerAdapter.cs
示例17: ASPXToPDF
public void ASPXToPDF(HtmlGenericControl objhtml)
{
string fileName = "AsignacionFolios.pdf";
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.Clear();
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
objhtml.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A2, 5f, 5f, 5f, 5f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, HttpContext.Current.Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);
pdfDoc.Close();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=" + fileName);
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Write(pdfDoc);
HttpContext.Current.Response.End();
}
开发者ID:FranciscoMontelongo,项目名称:Basica-Prom-Supervisores-Asigna15,代码行数:25,代码来源:PDFExpress.cs
示例18: AddSubtitle
private void AddSubtitle(HtmlGenericControl p)
{
this.subTitleHeading = new HtmlGenericControl();
this.subTitleHeading.TagName = "h2";
this.subTitleHeading.InnerText = Labels.TransactionPostedSuccessfully;
p.Controls.Add(this.subTitleHeading);
}
开发者ID:abinabrahamanchery,项目名称:mixerp,代码行数:7,代码来源:Heading.cs
示例19: btnsubmit_OnClick
protected void btnsubmit_OnClick(object sender, EventArgs e)
{
var h1 = new HtmlGenericControl("h1") { InnerText = "Student Info:" };
info.Controls.Add(h1);
info.Controls.Add(new HtmlGenericControl("strong"){InnerText = "First Name:"});
info.Controls.Add(new HtmlGenericControl("span") { InnerText = fName.Text });
info.Controls.Add(new LiteralControl("<br/>"));
info.Controls.Add(new HtmlGenericControl("strong") { InnerText = "Last Name:" });
info.Controls.Add(new HtmlGenericControl("span") { InnerText = lName.Text });
info.Controls.Add(new LiteralControl("<br/>"));
info.Controls.Add(new HtmlGenericControl("strong") { InnerText = "Facoulty Number:" });
info.Controls.Add(new HtmlGenericControl("span") { InnerText = fNum.Text });
info.Controls.Add(new LiteralControl("<br/>"));
info.Controls.Add(new HtmlGenericControl("strong") { InnerText = "University:" });
info.Controls.Add(new HtmlGenericControl("span") { InnerText = uni.SelectedItem.Value });
info.Controls.Add(new LiteralControl("<br/>"));
info.Controls.Add(new HtmlGenericControl("h2"){InnerText = "Courses:"});
var coursesList = new HtmlGenericControl("ul");
var indeces = courses.GetSelectedIndices();
foreach (var selectedIndex in courses.GetSelectedIndices())
{
coursesList.Controls.Add(new HtmlGenericControl("li"){InnerText = courses.Items[selectedIndex].Text});
}
info.Controls.Add(coursesList);
}
开发者ID:GenoGenov,项目名称:TelerikAcademyAssignments,代码行数:26,代码来源:RegStudent.aspx.cs
示例20: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Define an HtmlLink control.
HtmlLink TableLinkCss = new HtmlLink();
TableLinkCss.Href = Page.ResolveUrl("~/Manager/css/table/" + Common.TableSink + "/Css.css");
TableLinkCss.Attributes.Add("rel", "stylesheet");
TableLinkCss.Attributes.Add("type", "text/css");
// Add the HtmlLink to the Head section of the page.
Page.Header.Controls.Add(TableLinkCss);
HtmlGenericControl CheckLinkJs = new HtmlGenericControl("script");
CheckLinkJs.Attributes.Add("type", "text/javascript");
CheckLinkJs.Attributes.Add("src", Page.ResolveUrl("~/Manager/js/checkform.js"));
CheckLinkJs.Attributes.Add("charset", "utf-8");
Page.Header.Controls.Add(CheckLinkJs);
HtmlGenericControl dateLinkJs = new HtmlGenericControl("script");
dateLinkJs.Attributes.Add("src", Page.ResolveUrl("~/Manager/js/date/date.js"));
dateLinkJs.Attributes.Add("type", "text/javascript");
dateLinkJs.Attributes.Add("charset", "utf-8");
Page.Header.Controls.Add(dateLinkJs);
Page.Header.Controls[2].Visible = false;
}
开发者ID:zhanfuzhi,项目名称:shanligitproject,代码行数:34,代码来源:PageTemplate.Master.cs
注:本文中的System.Web.UI.HtmlControls.HtmlGenericControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论