System.Web.UI.HtmlControls Namespace HtmlGenericControl Class
Initializes a new instance of the HtmlGenericControl class using the specified tag name.
[ VB ]
Overloads Public Sub New ( _
ByVal tag As String _
)
[ C# ]
public HtmlGenericControl (
string tag
);
[ C++ ]
public: HtmlGenericControl (
String* tag
);
[ JScript ]
public function HtmlGenericControl (
tag : String
);
- tag
- A string that specifies the tag name of the control.
This constructor sets the initial TagName property value to the given tag argument. If this is an empty string, the initial TagName property value is set to span.
The below code shows how to create a new instance of the HtmlGenericControl class using the overloaded constructor.
[ VB ]
Sub Button_Click ( sender As Object, e As EventArgs )
Dim myControl As New HtmlGenericControl ( "Div" )
Message.InnerHtml = "New HtmlGenericControl Tag Name = " & myControl.TagName
End Sub 'Button_Click
[ C# ]
void Button_Click ( object src, EventArgs e ) {
HtmlGenericControl myControl = new HtmlGenericControl ( "Div" );
Message.InnerHtml="New HtmlGenericControl Tag Name = " + myControl.TagName;
}
[ JScript ]
function Button_Click ( sender : Object, e : EventArgs ) {
var myControl : HtmlGenericControl = new HtmlGenericControl ( "Div" )
Message.InnerHtml = "New HtmlGenericControl Tag Name = " + myControl.TagName
}
HtmlGenericControl Members HtmlGenericControl Constructor Overload List