La clase HTMLGenericControl puede crear controles del lado del servidor para asignar a los elementos HTML correspondientes sin ser convertidos por la clase .NET Framework. Por ejemplo, <body> <span>, etc. El siguiente ejemplo es crear dinámicamente elementos de título utilizando la clase HTMLGenericControl.
ChangePagetitle.aspx
<%@ page lenguaje = vb autoeventwireUp = false codeBeHind = ChangePageTitle.aspx.vb
heredes = aspxweb.mengxianhui.com.changepagetitle%>
<! Doctype html público -// w3c // dtd html 4.0 transitional // en>
<html>
<Evista>
<Title ID = myPageTitle runat = Server> </title>
<meta name = code_language content = Visual Basic 7.0>
<meta name = vs_defaultClientscript content = javaScript>
<meta name = vs_targetschema content = http: //schemas.microsoft.com/intellisense/ie5>
</ablo>
<Body MS_Positioning = GridLayout>
<Form ID = form1 método = post runat = servidor>
</form>
</body>
</html>
ChangePagetitle.aspx.vb
Cambio de clase pública PageTitle
Heredina System.Web.UI.Page
MyPagetitle protegido como nuevo htmlGenericControl ()
privado subpage_load (remitente Byval como System.Object, _
Byval E como System.Eventargs) Maneja mybase.load
mypagetitle.inntext = [Meng Xianhui's Wonderful World] .NET Developer Park
final
clase final