Skip to content

Commit a79c9b2

Browse files
Rick AndersonRon Petrusha
authored andcommitted
Update HtmlTextWriter.xml (dotnet#175)
* Update HtmlTextWriter.xml * Update HtmlTextWriter.xml * Update HtmlTextWriter.xml * Update HtmlTextWriter.xml * Update HtmlTextWriter.xml
1 parent a174c8a commit a79c9b2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

xml/System.Web.UI/HtmlTextWriter.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ alert('Hello');
290290
For an instance of any given markup element, the <xref:System.Web.UI.HtmlTextWriter> class maintains a list of attributes for that element. When the <xref:System.Web.UI.HtmlTextWriter.RenderBeginTag%2A> method is called, any attributes added by the <xref:System.Web.UI.HtmlTextWriter.AddAttribute%2A> method are rendered to the opening tag of the element. The list of attributes is then cleared from the <xref:System.Web.UI.HtmlTextWriter> object.
291291
292292
Use the <xref:System.Web.UI.HtmlTextWriter.AddAttribute%28System.String%2CSystem.String%2CSystem.Boolean%29> method with `fEncode` set to `true`, if the attribute can possibly contain a quotation mark ("), a less than sign (<), or an ampersand (&). The method call will encode the attribute to meet the requirements of the requesting device. You can set `fEncode` to `false`, if you know that none of these characters will be generated, or if you know that the attribute is already encoded.
293+
294+
If the attribute type is `Style`, the value won’t be encoded even if `fEndode` is `true`. Ensure that the style value is CSS-compliant and doesn’t contain malicious code.
293295
294296
The coding pattern for rendering markup elements is as follows:
295297
@@ -390,6 +392,9 @@ alert('Hello');
390392
For an instance of any given markup element, the <xref:System.Web.UI.HtmlTextWriter> class maintains a list of attributes for that element. When the <xref:System.Web.UI.HtmlTextWriter.RenderBeginTag%2A> method is called, any attributes added by the <xref:System.Web.UI.HtmlTextWriter.AddAttribute%2A> are rendered to the opening tag of the element. The list of attributes is then cleared from the <xref:System.Web.UI.HtmlTextWriter> object.
391393
392394
Use the <xref:System.Web.UI.HtmlTextWriter.AddAttribute%28System.Web.UI.HtmlTextWriterAttribute%2CSystem.String%2CSystem.Boolean%29> method with `fEncode` set to `true`, if the attribute can possibly contain a quotation mark ("), a less than sign (<), or an ampersand (&). The method call will encode the attribute to meet the requirements of the requesting device. You can set `fEncode` to `false`, if you know that none of these characters will be generated, or if you know that the attribute is already encoded.
395+
396+
If the attribute type is `Style`, the value won’t be encoded even if `fEncode` is `true`. Ensure that the style value is CSS-compliant and doesn’t contain malicious code.
397+
393398
394399
The coding pattern for rendering markup elements is as follows:
395400
@@ -4879,4 +4884,5 @@ alert('Hello');
48794884
</Docs>
48804885
</Member>
48814886
</Members>
4882-
</Type>
4887+
</Type>
4888+

0 commit comments

Comments
 (0)