本文整理匯總了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);
}
}
}