TextView Class
Provides a programmable control for displaying larger amounts of text, with optional markup tags on a mobile page.
Assembly: System.Web.Mobile (in System.Web.Mobile.dll)
[DesignerAdapterAttribute(L"System.Web.UI.Design.MobileControls.Adapters.DesignerTextViewAdapter")] [AspNetHostingPermissionAttribute(SecurityAction::InheritanceDemand, Level = AspNetHostingPermissionLevel::Minimal)] [AspNetHostingPermissionAttribute(SecurityAction::LinkDemand, Level = AspNetHostingPermissionLevel::Minimal)] public ref class TextView : public PagedControl
<mobile:TextView />
Unlike literal text in a mobile form, you can set content of a TextView from code. Unlike a mobile Label control, you can include markup within the value of the Text property. Also, the TextView control is careful not to break up inserted elements such as links during pagination. For more information, see Literal Text Inside Form Markup.
If the TextView control is within a Panel, set the Panel::Paginate property to true to allow text to flow across multiple pages on mobile devices. If the TextView control is not in a Panel, put the name of the TextView control into the Form::ControlToPaginate property.
Most other properties and methods of the mobile TextView control are of more use to developers of new device adapters for rendering the contents on specific devices.
Caution: |
|---|
This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. You can use validation controls to verify user input before displaying the input text in a control. ASP.NET provides an input request validation feature to block script and HTML in user input. For more information, see Securing Standard Controls, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Validating User Input in ASP.NET Web Pages. |
The following code example creates numbers and identifies each prime number in a sentence, and adds those sentences to the TextView control. The example also uses custom pagination to provide only a page full of text at a time.
Note: |
|---|
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information, see ASP.NET Web Page Code Model. |
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.
System.Web.UI::Control
System.Web.UI.MobileControls::MobileControl
System.Web.UI.MobileControls::PagedControl
System.Web.UI.MobileControls::TextView
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Caution:
Note: