asp.net.ph

HtmlGenericControl Constructor ( String )

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
);

Parameters

tag
A string that specifies the tag name of the control.

Remarks

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.

Example

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
}
See Also

HtmlGenericControl Members   HtmlGenericControl Constructor Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph