Spread for ASP.NET 8.0 Product Documentation
EncodeValue Property (FpSpread)
Example 


Gets or sets whether the Spread component encodes the values from the data model and the user's input using the HtmlEncode method.
Syntax
'Declaration
 
Public Property EncodeValue As Boolean
'Usage
 
Dim instance As FpSpread
Dim value As Boolean
 
instance.EncodeValue = value
 
value = instance.EncodeValue
public bool EncodeValue {get; set;}

Property Value

true to encode the values; otherwise false
Remarks

To write HTML tags in the cells, you would need to set this property to false. If you set this property to false, then you can embed HTML tags in the cell, for example to make part of the text bold by adding <B> and </B> tags. This applies to cells in the headers as well as cells in the data area.

The HtmlEncode method converts a string into an HTML-encoded string for reliable HTTP transmission from the Web server to a client. For more information on cross-site scripting security issues, see article Q252985 in the Microsoft Knowledge Base.

Example
This example shows how to turn off encoding to allow HTML tags.
FpSpread1.EncodeValue=false;
FpSpread1.Sheets[0].Cells[1,1].Value="Hello<B>World</B>.Y=X<SUP>2</SUP>";
FpSpread1.Sheets[0].Cells[2,1].Value="<AHREF='http://www.fpoint.com/'>FarPoint</A>-creatorsofSpread"
FpSpread1.Sheets[0].Cells[3,1].Value="Break&nbsp;here<BR>to&nbsp;anew&nbsp;line"
FpSpread1.Sheets[0].Cells[4,1].Value="<AHREF=""mailto:fpdocs@fpoint.com">Senddocfeedback</a>."
FpSpread1.EncodeValue=False
FpSpread1.Sheets(0).Cells(1,1).Value="Hello<B>World</B>"
FpSpread1.Sheets(0).Cells(2,1).Value="<AHREF='http://www.fpoint.com/'>FarPoint</a>-creatorsofSpread"
FpSpread1.Sheets(0).Cells(3,1).Value="Break&nbsp;here<BR>to&nbsp;anew&nbsp;line"
FpSpread1.Sheets(0).Cells(4,1).Value="<AHREF=""mailto:fpdocs@fpoint.com">Senddocfeedback</a>."
Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

FpSpread Class
FpSpread Members

User-Task Documentation

Understanding How Cell Types Display Data

 

 


Copyright © GrapeCity, inc. All rights reserved.