| |||||||||
HtmlContainerControl.InnerText PropertySystem.Web.UI.HtmlControls Namespace HtmlContainerControl Class Sets or retrieves the text between the start and end tags of the specified HTML server control. Syntax
This property can only be used programmatically; it cannot be set when declaring the control. Property Value
Exceptions
RemarksUse the InnerText property to programmatically modify the content between the opening and closing tags of an HTML server control. When setting the property, the given string completely replaces the existing content of the object, except for <html>, <head>, and <title> elements. Unlike the InnerHtml property, InnerText automatically encodes special characters to and from HTML character entities. HTML entities allow you to display special characters, such as the less than and greater than symbols [ < ... > ] , that a browser would normally interpret as HTML markup, and not display on the page. If these symbols are included in the string value for InnerText, these are internally parsed into the character entities < and >, respectively, and are rendered on the page as such. To prevent automatic HTML encoding and decoding, use the InnerHtml property instead. ExampleThis example demonstrates a simple way to modify the Innertext of an HtmlAnchor control depending on the status of another control. showhideLink.InnerText = image.Visible ? "Hide Image" : "Show Image"; This example demonstrates how you can retrieve the InnerText property of one control, in this case an HmlButton control, and assign it as part of the value of another control, in this case the Text property of a Label control. msg.Text = "Check out other " + ( ( HtmlButton ) sender ).InnerText + " books at Amazon." See AlsoHtmlContainerControl Members InnerHtml |
| ||||||||
Check out related books at Amazon
© 2000-2008 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 aspxtreme