CheckBox.OnPreRender Method (EventArgs)
.NET Framework (current version)
This API supports the product infrastructure and is not intended to be used directly from your code.
Registers client script for generating postback prior to rendering on the client if AutoPostBack is true.
Assembly: System.Web (in System.Web.dll)
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB.Controls" Assembly="Samples.AspNet.VB" %> <%@ Page language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Custom CheckBox - OnPreRender - VB.NET Example</title> </head> <body> <form id="Form1" method="post" runat="server"> <h3>Custom CheckBox - OnPreRender - VB.NET Example</h3> <aspSample:CustomCheckBoxOnPreRender id="CheckBox1" runat="server" text="CheckBox1" /> </form> </body> </html>
Imports System.Web Imports System.Security.Permissions Namespace Samples.AspNet.VB.Controls <AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _ Public Class CustomCheckBoxOnPreRender Inherits System.Web.UI.WebControls.CheckBox Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs) ' Run the OnPreRender method on the base class. MyBase.OnPreRender(e) ' Display a LightGray BackColor for the CheckBox. Me.BackColor = System.Drawing.Color.LightGray End Sub 'OnPreRender End Class 'CustomCheckBoxOnPreRender End Namespace
.NET Framework
Available since 1.1
Available since 1.1
Show: