日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

HtmlGenericControl

發(fā)布時間:2023/12/9 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HtmlGenericControl 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
HtmlGenericControl 構造函數 (String)使用指定的標記初始化 HtmlGenericControl 類的新實例。命名空間: System.Web.UI.HtmlControls 程序集: System.Web(在 System.Web.dll 中) 語法Public Sub New ( _tag As String _ )public HtmlGenericControl(string tag)public: HtmlGenericControl(String^ tag )new : tag:string -> HtmlGenericControl參數tag類型:System..::.String要為其創(chuàng)建該類的此實例的元素的名稱。備注使用此構造函數創(chuàng)建并初始化使用指定標記的 HtmlGenericControl 類的新實例。 這使您可以動態(tài)創(chuàng)建不直接由 .NET Framework 類表示的任何 HTML 服務器控件元素。下表顯示 HtmlGenericControl 實例的初始屬性值。Property初始值TagNametag 參數的值。 注意注意如果 tag 參數為 nullNothingnullptrnull 引用(在 Visual Basic 中為 Nothing),則 TagName 屬性設置為 String..::.Empty。 示例下面的代碼示例演示如何使用重載構造函數創(chuàng)建 HtmlGenericControl 類的新實例。<%@ Page Language="VB" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)' Create a new HtmlGenericControl.Dim NewControl As New HtmlGenericControl("div")' Set the properties of the new HtmlGenericControl control.NewControl.ID = "NewControl"NewControl.InnerHtml = "This is a dynamically created HTML server control."' Add the new HtmlGenericControl to the Controls collection of the' PlaceHolder control. ControlContainer.Controls.Add(NewControl)End Sub</script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"><title>HtmlGenericControl Constructor Example</title> </head> <body><form id="form1" runat="server"><div><h3> HtmlGenericControl Constructor Example </h3><asp:PlaceHolder ID="ControlContainer"runat="server"/></div></form></body> </html><%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">void Page_Load(Object sender, EventArgs e){// Create a new HtmlGenericControl.HtmlGenericControl NewControl = new HtmlGenericControl("div");// Set the properties of the new HtmlGenericControl control.NewControl.ID = "NewControl";NewControl.InnerHtml = "This is a dynamically created HTML server control.";// Add the new HtmlGenericControl to the Controls collection of the// PlaceHolder control. ControlContainer.Controls.Add(NewControl);}</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"><title>HtmlGenericControl Constructor Example</title></head><body><form id="form1" runat="server"><div><h3> HtmlGenericControl Constructor Example </h3><asp:PlaceHolder ID="ControlContainer"runat="server"/></div></form></body></html>

轉載于:https://www.cnblogs.com/vmyspace/archive/2012/03/01/2375094.html

總結

以上是生活随笔為你收集整理的HtmlGenericControl的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。