本文整理汇总了C#中System.Web.UI.AttributeCollection.Render方法的典型用法代码示例。如果您正苦于以下问题:C# AttributeCollection.Render方法的具体用法?C# AttributeCollection.Render怎么用?C# AttributeCollection.Render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.AttributeCollection
的用法示例。
在下文中一共展示了AttributeCollection.Render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
/* Create a custom WebControl class, named AttribRender, that overrides
the Render method to write two introductory strings. Then call the
AttributeCollection.Render method, which allows the control to write the
attribute values that are added to it when it is included in a page.
*/
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Security.Permissions;
// Create the namespace that contains the AttribRender and the
// page that accesses it.
namespace AC_Render
{
// This is the custom WebControl class.
[AspNetHostingPermission(SecurityAction.Demand,
Level=AspNetHostingPermissionLevel.Minimal)]
public class AttribRender : WebControl
{
// This is the overridden WebControl.Render method.
protected override void Render(HtmlTextWriter output)
{
output.Write("<h2>An AttributeCollection.Render Method Example</h2>");
output.Write("The attributes, and their values, added to the ctl1 control are <br><br>");
// This is the AttributeCollection.Render method call. When the
// page that contains this control is requested, the
// attributes that the page adds, and their values,
// are rendered to the page.
Attributes.Render(output);
}
}
}