From d40581d63520bdc58454d15badffa56bb5367eac Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:10:54 -0800 Subject: [PATCH 1/2] add table headers --- xml/System.AddIn.Hosting/AddInProcess.xml | 138 +- xml/System.AddIn.Hosting/Platform.xml | 25 +- xml/System.Buffers.Text/Utf8Formatter.xml | 10 +- xml/System.Buffers.Text/Utf8Parser.xml | 40 +- .../ConcurrentDictionary`2.xml | 12 +- .../ImmutableArray`1.xml | 294 +-- .../DesignerProperties.xml | 48 +- xml/System.Data.SqlClient/SqlDataReader.xml | 1161 ++++----- .../PackageDigitalSignature.xml | 162 +- .../PackageRelationship.xml | 168 +- xml/System.Numerics/BigInteger.xml | 9 +- .../PaddingMode.xml | 23 +- xml/System.Text.RegularExpressions/Match.xml | 19 +- xml/System.Text.RegularExpressions/Regex.xml | 14 +- .../AntiXssEncoder.xml | 1174 ++++----- .../ActiveDirectoryMembershipUser.xml | 232 +- .../DataPoint.xml | 232 +- .../DataPointCollection.xml | 336 +-- .../CheckBoxList.xml | 862 +++--- xml/System.Web.UI.WebControls/DataList.xml | 2322 ++++++++--------- xml/System.Web.UI.WebControls/Parameter.xml | 18 +- .../RadioButtonList.xml | 702 +++-- .../RepeatDirection.xml | 54 +- xml/System.Web.UI.WebControls/RepeatInfo.xml | 148 +- xml/System.Web.UI/ChtmlTextWriter.xml | 346 ++- xml/System.Web.UI/ObjectStateFormatter.xml | 254 +- .../WorkflowServiceAttributes.xml | 279 +- xml/System.Xml/XmlTextReader.xml | 18 +- xml/System.Xml/XmlValidatingReader.xml | 2262 ++++++++-------- xml/System/BitConverter.xml | 450 ++-- xml/System/Char.xml | 375 ++- 31 files changed, 6183 insertions(+), 6004 deletions(-) diff --git a/xml/System.AddIn.Hosting/AddInProcess.xml b/xml/System.AddIn.Hosting/AddInProcess.xml index c2e30b91518..03d9777e427 100644 --- a/xml/System.AddIn.Hosting/AddInProcess.xml +++ b/xml/System.AddIn.Hosting/AddInProcess.xml @@ -17,21 +17,21 @@ Provides an external process for running add-ins out-of-process from the host application. - object to the appropriate method overload. - - The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the constructor to create the object. - - - -## Examples - The following example activates an add-in in an external process. - + object to the appropriate method overload. + + The executable that runs the add-in is obtained from one of two files installed with the .NET Framework under the Windows directory. By default, the executable that matches the bits-per-word of the host application is used. If the host is a 64-bit process, AddInProcess.exe is run; otherwise, AddInProcess32.exe is run. To specify the way the executable is selected, use the constructor to create the object. + + + +## Examples + The following example activates an add-in in an external process. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/addinP3Host/vb/p3host.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/addinP3Host/vb/p3host.vb" id="Snippet10"::: + ]]> Add-Ins and Extensibility @@ -72,11 +72,11 @@ Initializes a new instance of the class. - constructor with the flag, to specify that the process that runs the add-in will have the same bits-per-word as the host process. - + constructor with the flag, to specify that the process that runs the add-in will have the same bits-per-word as the host process. + ]]> @@ -106,24 +106,24 @@ A value that specifies the bits-per-word of the process that runs the add-in. Initializes a new instance of the class, specifying the bits-per-word of the process in which the add-in runs. - - The registry entry for the path to the executable (AddInProcess.exe or AddInProcess32.exe) is missing. - - -or- - + The registry entry for the path to the executable (AddInProcess.exe or AddInProcess32.exe) is missing. + + -or- + The executable is missing. @@ -148,22 +148,22 @@ if the object corresponds to the current process; otherwise, . - or method throws an . - + or method throws an . + > [!NOTE] -> The property returns an object that represents the host application process if the add-in is running in-process. - - - -## Examples - The following example activates an add-in in an external process and uses the property to determine whether the add-in is in the same process as the host application process. - +> The property returns an object that represents the host application process if the add-in is running in-process. + + + +## Examples + The following example activates an add-in in an external process and uses the property to determine whether the add-in is in the same process as the host application process. + :::code language="csharp" source="~/snippets/csharp/System.AddIn.Hosting/AddInController/Overview/P3Host.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/addinP3Host/vb/p3host.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR/addinP3Host/vb/p3host.vb" id="Snippet10"::: + ]]> @@ -199,11 +199,11 @@ if the external process should be kept alive; otherwise, . The default is . - @@ -233,11 +233,11 @@ Gets the bits-per-word of the process in which the out-of-process add-in is run. The bits-per-word of the process that runs the add-in. - object is initialized, and cannot be changed. - + object is initialized, and cannot be changed. + ]]> @@ -262,11 +262,11 @@ Gets the process ID of the external process. The process ID, or -1 if the external process has not started. - @@ -374,11 +374,11 @@ Gets or sets the number of seconds to allow for the process to start. The number of seconds to allow for process startup. - The process is already running. diff --git a/xml/System.AddIn.Hosting/Platform.xml b/xml/System.AddIn.Hosting/Platform.xml index 733af47cf19..6b3e092c60b 100644 --- a/xml/System.AddIn.Hosting/Platform.xml +++ b/xml/System.AddIn.Hosting/Platform.xml @@ -21,19 +21,18 @@ Specifies the bits-per-word of the process in which an out-of-process add-in is run. - diff --git a/xml/System.Buffers.Text/Utf8Formatter.xml b/xml/System.Buffers.Text/Utf8Formatter.xml index fbc84c970db..a36ef1ccb04 100644 --- a/xml/System.Buffers.Text/Utf8Formatter.xml +++ b/xml/System.Buffers.Text/Utf8Formatter.xml @@ -765,11 +765,11 @@ If the method fails, iteratively increase the size of the buffer and retry until Formats supported: -|Format string|Result string|Comments| -|--|--|--| -|c/t/T (default)|[-][d.]hh:mm:ss[.fffffff]|(constant format)| -|G|[-]d:hh:mm:ss.fffffff||(general long)| -|g|[-][d:][h]h:mm:ss[.f[f[f[f[f[f[f]]]]]]|(general short)| +| Format string | Result string | Comments | +|-----------------|----------------------------------------|-------------------| +| c/t/T (default) | [-][d.]hh:mm:ss[.fffffff] | (constant format) | +| G | [-]d:hh:mm:ss.fffffff | (general long) | +| g | [-][d:][h]h:mm:ss[.f[f[f[f[f[f[f]]]]]] | (general short) | If the method fails, iteratively increase the size of the buffer and retry until it succeeds. diff --git a/xml/System.Buffers.Text/Utf8Parser.xml b/xml/System.Buffers.Text/Utf8Parser.xml index cb34ba4fdb1..b7bfcbfba44 100644 --- a/xml/System.Buffers.Text/Utf8Parser.xml +++ b/xml/System.Buffers.Text/Utf8Parser.xml @@ -130,13 +130,13 @@ The parsing is case insensitive. The format parameter is validated to ensure it @@ -302,7 +302,7 @@ Formats supported: |Format string|Example expected format|Comments| |--|--|--| -|G/g (default)| | +|G/g (default)| | |F/f|12.45|Fixed point| |E/e|1.245000e1|Exponential| @@ -357,7 +357,7 @@ Formats supported: |Format string|Example expected format|Comments| |--|--|--| -|G/g (default)| | +|G/g (default)| | |F/f|12.45|Fixed point| |E/e|1.245000e1|Exponential| @@ -470,7 +470,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> @@ -526,7 +526,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> @@ -582,7 +582,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> @@ -638,13 +638,13 @@ Formats supported: @@ -694,11 +694,11 @@ Formats supported: @@ -816,7 +816,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> @@ -878,7 +878,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> @@ -940,7 +940,7 @@ Formats supported: |--|--| |G/g (default)| | |D/d|32767| -|N/n|32,767| +|N/n|32,767| |X/x|7fff| ]]> diff --git a/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml b/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml index 3306d3915ec..827429ad799 100644 --- a/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml +++ b/xml/System.Collections.Concurrent/ConcurrentDictionary`2.xml @@ -123,11 +123,11 @@ Like the class, implements the interface. In addition, provides several methods for adding or updating key/value pairs in the dictionary, as described in the following table. -|To do this|Use this method|Usage notes| -|----------------|---------------------|-----------------| +| To do this | Use this method | Usage notes | +|------------|-----------------|-------------| |Add a new key to the dictionary, if it doesn't already exist in the dictionary||This method adds the specified key/value pair, if the key doesn't currently exist in the dictionary. The method returns `true` or `false` depending on whether the new pair was added.| |Update the value for an existing key in the dictionary, if that key has a specific value||This method checks whether the key has a specified value, and if it does, updates the key with a new value. It's similar to the method, except that it's used for dictionary elements.| -|Store a key/value pair in the dictionary unconditionally, and overwrite the value of a key that already exists|The indexer's setter: `dictionary[key] = newValue`|| +|Store a key/value pair in the dictionary unconditionally, and overwrite the value of a key that already exists|The indexer's setter: `dictionary[key] = newValue`| | |Add a key/value pair to the dictionary, or if the key already exists, update the value for the key based on the key's existing value|

-or-

| accepts the key and two delegates. It uses the first delegate if the key doesn't exist in the dictionary; it accepts the key and returns the value that should be added for the key. It uses the second delegate if the key does exist; it accepts the key and its current value, and it returns the new value that should be set for the key.

accepts the key, a value to add, and the update delegate. This is the same as the previous overload, except that it doesn't use a delegate to add a key.| |Get the value for a key in the dictionary, adding the value to the dictionary and returning it if the key doesn't exist|

-or-

|These overloads provide lazy initialization for a key/value pair in the dictionary, adding the value only if it's not there.

takes the value to be added if the key doesn't exist.

takes a delegate that will generate the value if the key doesn't exist.| @@ -2703,14 +2703,14 @@ This member is an explicit interface member implementation. It can be used only The alternate type of a key for performing lookups. The created lookup instance when the method returns , or a default instance that should not be used if the method returns . - Gets an instance of a type that may be used to perform operations on a + Gets an instance of a type that may be used to perform operations on a using a as a key instead of a . if a lookup could be created; otherwise, . - This instance must be using a comparer that implements with - and . If it doesn't, the method will return . + This instance must be using a comparer that implements with + and . If it doesn't, the method will return . diff --git a/xml/System.Collections.Immutable/ImmutableArray`1.xml b/xml/System.Collections.Immutable/ImmutableArray`1.xml index f0f9395c9a8..6dd4f5b43c8 100644 --- a/xml/System.Collections.Immutable/ImmutableArray`1.xml +++ b/xml/System.Collections.Immutable/ImmutableArray`1.xml @@ -94,36 +94,32 @@ The type of element stored by the array. - Represents an array that is immutable; meaning it cannot be changed once it is created. - + Represents an array that is immutable; meaning it cannot be changed once it is created. + **NuGet package**: System.Collections.Immutable (about immutable collections and how to install) - and others best for . - - Reasons to use immutable array: - -- Updating the data is rare or the number of elements is quite small (less than 16 items) - -- You need to be able to iterate over the data in performance critical sections - -- You have many instances of immutable collections and you can't afford keeping the data in trees - - Reasons to use immutable list: - -- Updating the data is common or the number of elements isn't expected to be small - -- Updating the collection is more performance critical than iterating the contents - - The following table summarizes the performance characteristics of - -||||| -|-|-|-|-| -|**Operation**| Complexity| Complexity|**Comments**| -|**Item**|O(1)|O(log n)|Directly index into the underlying array| -|**Add()**|O(n)|O(log n)|Requires creating a new array| + and others best for . + + Reasons to use immutable array: + +- Updating the data is rare or the number of elements is quite small (less than 16 items) +- You need to be able to iterate over the data in performance critical sections +- You have many instances of immutable collections and you can't afford keeping the data in trees + + Reasons to use immutable list: + +- Updating the data is common or the number of elements isn't expected to be small +- Updating the collection is more performance critical than iterating the contents + +The following table summarizes the performance characteristics of + +| Operation | ImmutableArray complexity | ImmutableList complexity | Comments | +| --------- | ------------------------- | ------------------------ | -------- | +| `Item` | O(1) | O(log n) | Directly index into the underlying array | +| `Add()` | O(n) | O(log n) | Requires creating a new array | ## Examples This example shows how to create an immutable array and iterate over elements in it: @@ -136,8 +132,8 @@ This example shows how to create a new immutable array by adding and removing it This example shows how to create an immutable array using : -:::code language="csharp" source="~/snippets/csharp/System.Collections.Immutable/ImmutableArray`1/Overview/ImmutableArraySnippets.cs" id="SnippetBuilder"::: - +:::code language="csharp" source="~/snippets/csharp/System.Collections.Immutable/ImmutableArray`1/Overview/ImmutableArraySnippets.cs" id="SnippetBuilder"::: + ]]> This type is thread safe. @@ -528,13 +524,13 @@ This example shows how to create an immutable array using Returns a new immutable array that contains the elements of this array cast to a different type. An immutable array that contains the elements of this array, cast to a different type. If the cast fails, returns an array whose property returns . - method can be reversed using the method. However, a downcast is only successful when it reverses a prior upcast. operation. - + method can be reversed using the method. However, a downcast is only successful when it reverses a prior upcast. operation. + ]]> @@ -755,11 +751,11 @@ This example shows how to create an immutable array using Initializes a new instance of the struct based on the contents of an existing instance, allowing a covariant static cast to efficiently reuse the existing array. An immutable array instance with elements cast to the new type. - or method. - + or method. + ]]> @@ -2363,8 +2359,8 @@ This example shows how to create an immutable array using The item to remove. The equality comparer to use in the search. - Returns an array with the first occurrence of the specified element removed from the array. - + Returns an array with the first occurrence of the specified element removed from the array. + If no match is found, the current array is returned. A new array with the specified item removed. To be added. @@ -3090,11 +3086,11 @@ This example shows how to create an immutable array using The item to add to the end of the array. Throws in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3132,11 +3128,11 @@ This example shows how to create an immutable array using Throws in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3262,11 +3258,11 @@ This example shows how to create an immutable array using Throws in all cases. Throws in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3305,11 +3301,11 @@ This example shows how to create an immutable array using Returns an enumerator that iterates through the array. An enumerator that can be used to iterate through the array. - instance is cast to an interface. - + instance is cast to an interface. + ]]> The property returns . @@ -3353,11 +3349,11 @@ This example shows how to create an immutable array using The item to insert. Throws in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3561,11 +3557,11 @@ This example shows how to create an immutable array using The index in the destination array to start the copy operation. Copies this array to another array starting at the specified index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4223,11 +4219,11 @@ This member is an explicit interface member implementation. It can be used only Returns a copy of the original array with the specified item added to the end. A new array with the specified item added to the end. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4269,11 +4265,11 @@ This member is an explicit interface member implementation. It can be used only Returns a copy of the original array with the specified elements added to the end of the array. A new array with the elements added to the end. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4312,11 +4308,11 @@ This member is an explicit interface member implementation. It can be used only Returns an array with all the elements removed. An array with all the elements removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4360,11 +4356,11 @@ This member is an explicit interface member implementation. It can be used only Returns a new array with the specified value inserted at the specified position. A new array with the specified value inserted. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4408,11 +4404,11 @@ This member is an explicit interface member implementation. It can be used only Inserts the specified values at the specified index. A new array with the specified values inserted. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4456,11 +4452,11 @@ This member is an explicit interface member implementation. It can be used only Returns an array with the first occurrence of the specified element removed from the array; if no match is found, the current array is returned. A new array with the value removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4502,11 +4498,11 @@ This member is an explicit interface member implementation. It can be used only Removes all the items from the array that meet the specified condition. A new array with items that meet the specified condition removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4548,11 +4544,11 @@ This member is an explicit interface member implementation. It can be used only Returns an array with the element at the specified position removed. A new array with the specified item removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4596,11 +4592,11 @@ This member is an explicit interface member implementation. It can be used only Removes the specified items from this array. A new array with the elements removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4644,11 +4640,11 @@ This member is an explicit interface member implementation. It can be used only Returns an array with the elements at the specified position removed. The new array with the specified elements removed. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4694,11 +4690,11 @@ This member is an explicit interface member implementation. It can be used only Finds the first element in the array equal to the specified value and replaces the value with the specified new value. A new array that contains even if the new and old values are the same. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4744,11 +4740,11 @@ This member is an explicit interface member implementation. It can be used only Replaces the item at the specified index with the specified item. The new array that contains at the specified index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4792,11 +4788,11 @@ This member is an explicit interface member implementation. It can be used only Determines whether the current collection element precedes, occurs in the same position as, or follows another element in the sort order. An integer that indicates whether the current element precedes, is in the same position or follows the other element. - instance is cast to an interface. - + instance is cast to an interface. + ]]> The arrays are not the same length. @@ -4842,11 +4838,11 @@ This member is an explicit interface member implementation. It can be used only if the two arrays are structurally equal; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -4921,11 +4917,11 @@ This member is an explicit interface member implementation. It can be used only Creates a mutable array that has the same contents as this array and can be efficiently mutated across multiple operations using standard mutable interfaces. The new builder with the same contents as this array. - diff --git a/xml/System.ComponentModel/DesignerProperties.xml b/xml/System.ComponentModel/DesignerProperties.xml index f343ec5c9ed..5693d6f9fd4 100644 --- a/xml/System.ComponentModel/DesignerProperties.xml +++ b/xml/System.ComponentModel/DesignerProperties.xml @@ -22,11 +22,11 @@ Provides attached properties used to communicate with a designer. - class provides attached properties that can be used to query the state of a control when it is running in a designer. Designer tools will set values for properties on objects that are running in the designer. - + class provides attached properties that can be used to query the state of a control when it is running in a designer. Designer tools will set values for properties on objects that are running in the designer. + ]]> @@ -91,21 +91,19 @@ Gets or sets whether a is running in the context of a designer. - method and update their state if their **IsInDesignMode** property value changes. - - -## Dependency Property Information - -||| -|-|-| -|Identifier field|| -|Metadata properties set to `true`|, | - + method and update their state if their **IsInDesignMode** property value changes. + +## Dependency Property Information + +| Identifier field | Metadata properties set to `true` | +|------------------|-----------------------------------| +| | , | + ]]> @@ -134,11 +132,11 @@ Identifies the attached property. - attached property. - + attached property. + ]]> diff --git a/xml/System.Data.SqlClient/SqlDataReader.xml b/xml/System.Data.SqlClient/SqlDataReader.xml index 78441e0e847..5501ef03d65 100644 --- a/xml/System.Data.SqlClient/SqlDataReader.xml +++ b/xml/System.Data.SqlClient/SqlDataReader.xml @@ -72,30 +72,30 @@ Provides a way of reading a forward-only stream of rows from a SQL Server database. This class cannot be inherited. - , you must call the method of the object, instead of directly using a constructor. - - While the is being used, the associated is busy serving the , and no other operations can be performed on the other than closing it. This is the case until the method of the is called. For example, you cannot retrieve output parameters until after you call . - - Changes made to a result set by another process or thread while data is being read may be visible to the user of the `SqlDataReader`. However, the precise behavior is timing dependent. - - and are the only properties that you can call after the is closed. Although the property may be accessed while the exists, always call before returning the value of to guarantee an accurate return value. - - When using sequential access (), an will be raised if the position is advanced and another read operation is attempted on the previous column. - + , you must call the method of the object, instead of directly using a constructor. + + While the is being used, the associated is busy serving the , and no other operations can be performed on the other than closing it. This is the case until the method of the is called. For example, you cannot retrieve output parameters until after you call . + + Changes made to a result set by another process or thread while data is being read may be visible to the user of the `SqlDataReader`. However, the precise behavior is timing dependent. + + and are the only properties that you can call after the is closed. Although the property may be accessed while the exists, always call before returning the value of to guarantee an accurate return value. + + When using sequential access (), an will be raised if the position is advanced and another read operation is attempted on the previous column. + > [!NOTE] -> For optimal performance, avoids creating unnecessary objects or making unnecessary copies of data. Therefore, multiple calls to methods such as return a reference to the same object. Use caution if you are modifying the underlying value of the objects returned by methods such as . - - - -## Examples - The following example creates a , a , and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. - +> For optimal performance, avoids creating unnecessary objects or making unnecessary copies of data. Therefore, multiple calls to methods such as return a reference to the same object. Use caution if you are modifying the underlying value of the objects returned by methods such as . + + + +## Examples + The following example creates a , a , and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/VB/source.vb" id="Snippet1"::: + ]]> DataAdapters and DataReaders @@ -136,24 +136,24 @@ Closes the object. - method when you are through using the to use the associated for any other purpose. - - The `Close` method fills in the values for output parameters, return values and `RecordsAffected`, increasing the time that it takes to close a `SqlDataReader` that was used to process a large or complex query. When the return values and the number of records affected by a query are not significant, the time that it takes to close the `SqlDataReader` can be reduced by calling the method of the associated object before calling the `Close` method. - + method when you are through using the to use the associated for any other purpose. + + The `Close` method fills in the values for output parameters, return values and `RecordsAffected`, increasing the time that it takes to close a `SqlDataReader` that was used to process a large or complex query. When the return values and the number of records affected by a query are not significant, the time that it takes to close the `SqlDataReader` can be reduced by calling the method of the associated object before calling the `Close` method. + > [!CAUTION] -> Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](/dotnet/standard/garbage-collection/). - - - -## Examples - The following example creates a , a `SqlCommand`, and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. - +> Do not call `Close` or `Dispose` on a Connection, a DataReader, or any other managed object in the `Finalize` method of your class. In a finalizer, you should only release unmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a `Finalize` method in your class definition. For more information, see [Garbage Collection](/dotnet/standard/garbage-collection/). + + + +## Examples + The following example creates a , a `SqlCommand`, and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Close Example/CS/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Close Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Close Example/VB/source.vb" id="Snippet1"::: + ]]> DataAdapters and DataReaders @@ -235,11 +235,11 @@ Gets a value that indicates the depth of nesting for the current row. The depth of nesting for the current row. - DataAdapters and DataReaders (ADO.NET) @@ -284,11 +284,11 @@ Gets the number of columns in the current row. When not positioned in a valid recordset, 0; otherwise the number of columns in the current row. The default is -1. - to 0. However. this should not be confused with a query that returns 0 rows (such as SELECT * FROM *table* WHERE 1 = 2) in which case returns the number of columns in the table, including hidden fields. Use to exclude hidden fields. - + to 0. However. this should not be confused with a query that returns 0 rows (such as SELECT * FROM *table* WHERE 1 = 2) in which case returns the number of columns in the table, including hidden fields. Use to exclude hidden fields. + ]]> There is no current connection to an instance of SQL Server. @@ -340,13 +340,13 @@ Gets the value of the specified column as a Boolean. The value of the column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -398,13 +398,13 @@ Gets the value of the specified column as a byte. The value of the specified column as a byte. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -464,15 +464,15 @@ Reads a stream of bytes from the specified column offset into the buffer an array starting at the given buffer offset. The actual number of bytes read. - returns the number of available bytes in the field. Most of the time this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetBytes` has already been used to obtain bytes from the field. This may be the case, for example, if the is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for . - - If you pass a buffer that is `null`, returns the length of the entire field in bytes, not the remaining size based on the buffer offset parameter. - - No conversions are performed; therefore, the data retrieved must already be a byte array. - + returns the number of available bytes in the field. Most of the time this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetBytes` has already been used to obtain bytes from the field. This may be the case, for example, if the is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for . + + If you pass a buffer that is `null`, returns the length of the entire field in bytes, not the remaining size based on the buffer offset parameter. + + No conversions are performed; therefore, the data retrieved must already be a byte array. + ]]> DataAdapters and DataReaders (ADO.NET) @@ -529,11 +529,11 @@ Gets the value of the specified column as a single character. The value of the specified column. - . - + . + ]]> The specified cast is not valid. @@ -591,18 +591,18 @@ Reads a stream of characters from the specified column offset into the buffer as an array starting at the given buffer offset. The actual number of characters read. - returns the number of available characters in the field. Frequently this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetChars` has already been used to obtain characters from the field. This may be the case, for example, if the is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for . - - The actual number of characters read can be less than the requested length, if the end of the field is reached. If you pass a buffer that is `null`, returns the length of the entire field in characters, not the remaining size based on the buffer offset parameter. - - No conversions are performed; therefore. the data retrieved must already be a character array. - + returns the number of available characters in the field. Frequently this is the exact length of the field. However, the number returned may be less than the true length of the field if `GetChars` has already been used to obtain characters from the field. This may be the case, for example, if the is reading a large data structure into a buffer. For more information, see the `SequentialAccess` setting for . + + The actual number of characters read can be less than the requested length, if the end of the field is reached. If you pass a buffer that is `null`, returns the length of the entire field in characters, not the remaining size based on the buffer offset parameter. + + No conversions are performed; therefore. the data retrieved must already be a character array. + > [!NOTE] -> The method returns 0 when `dataIndex` is negative. - +> The method returns 0 when `dataIndex` is negative. + ]]> DataAdapters and DataReaders (ADO.NET) @@ -715,13 +715,13 @@ Gets a string representing the data type of the specified column. The string representing the data type of the specified column. - ADO.NET Overview @@ -770,13 +770,13 @@ Gets the value of the specified column as a object. The value of the specified column. - object. - - Call to check for null values before calling this method. - + object. + + Call to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -819,13 +819,13 @@ Retrieves the value of the specified column as a object. The value of the specified column. - object. - - Call to check for null values before calling this method. - + object. + + Call to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -878,13 +878,13 @@ Gets the value of the specified column as a object. The value of the specified column. - object. - - Call to check for null values before calling this method. - + object. + + Call to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -936,13 +936,13 @@ Gets the value of the specified column as a double-precision floating point number. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -982,11 +982,11 @@ Returns an that iterates through the . An for the . - DataAdapters and DataReaders (ADO.NET) @@ -1042,7 +1042,7 @@ ## Remarks This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + This information can be used to increase performance by indicating the strongly-typed accessor to call. (for example, using `GetInt32` is roughly ten times faster than using `GetValue`.) ]]> @@ -1096,33 +1096,25 @@ This member is an explicit interface member implementation. It can be used only Synchronously gets the value of the specified column as a type. is the asynchronous version of this method. The returned type object. - .||| - - For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). - + ). + + For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). + ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Tried to read a previously-read column in sequential mode. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Tried to read a previously-read column in sequential mode. + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. Trying to read a column that does not exist. The value of the column was null ( == ), retrieving a non-SQL type. @@ -1176,35 +1168,27 @@ This member is an explicit interface member implementation. It can be used only Asynchronously gets the value of the specified column as a type. is the synchronous version of this method. The returned type object. - .||| - - For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). - + ). + + For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). + ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Tried to read a previously-read column in sequential mode. - - There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Tried to read a previously-read column in sequential mode. + + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. + is specified in the connection string. Trying to read a column that does not exist. The value of the column was null ( == ), retrieving a non-SQL type. @@ -1256,13 +1240,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a single-precision floating point number. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -1314,13 +1298,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a globally unique identifier (GUID). The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -1372,13 +1356,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a 16-bit signed integer. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -1430,13 +1414,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a 32-bit signed integer. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -1488,13 +1472,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a 64-bit signed integer. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -1594,23 +1578,23 @@ This member is an explicit interface member implementation. It can be used only Gets the column ordinal, given the name of the column. The zero-based column ordinal. - method. - + method. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.GetOrdinal/CS/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.GetOrdinal/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.GetOrdinal/VB/source.vb" id="Snippet1"::: + ]]> The name specified is not a valid column name. @@ -1772,47 +1756,47 @@ This member is an explicit interface member implementation. It can be used only Returns a that describes the column metadata of the . A that describes the column metadata. - method returns the following metadata about each column: - -|DataReader column|Description| -|-----------------------|-----------------| -|AllowDBNull|Set if the consumer can set the column to a null value or if the provider cannot determine whether the consumer can set the column to a null value. Otherwise, not set. A column may contain null values, even if it cannot be set to a null value.| -|BaseCatalogName|The name of the catalog in the data store that contains the column. NULL if the base catalog name cannot be determined. The default of this column is a null value.| -|BaseColumnName|The name of the column in the data store. This might be different than the column name returned in the ColumnName column if an alias was used. A null value if the base column name cannot be determined or if the rowset column is derived, but not identical to, a column in the data store. The default of this column is a null value.| -|BaseSchemaName|The name of the schema in the data store that contains the column. A null value if the base schema name cannot be determined. The default of this column is a null value.| -|BaseServerName|The name of the instance of Microsoft SQL Server used by the .| -|BaseTableName|The name of the table or view in the data store that contains the column. A null value if the base table name cannot be determined. The default of this column is a null value.| -|ColumnName|The name of the column; this might not be unique. If this cannot be determined, a null value is returned. This name always reflects the most recent renaming of the column in the current view or command text.| -|ColumnOrdinal|The zero-based ordinal of the column. This column cannot contain a null value.| + method returns the following metadata about each column: + +|DataReader column|Description| +|-----------------------|-----------------| +|AllowDBNull|Set if the consumer can set the column to a null value or if the provider cannot determine whether the consumer can set the column to a null value. Otherwise, not set. A column may contain null values, even if it cannot be set to a null value.| +|BaseCatalogName|The name of the catalog in the data store that contains the column. NULL if the base catalog name cannot be determined. The default of this column is a null value.| +|BaseColumnName|The name of the column in the data store. This might be different than the column name returned in the ColumnName column if an alias was used. A null value if the base column name cannot be determined or if the rowset column is derived, but not identical to, a column in the data store. The default of this column is a null value.| +|BaseSchemaName|The name of the schema in the data store that contains the column. A null value if the base schema name cannot be determined. The default of this column is a null value.| +|BaseServerName|The name of the instance of Microsoft SQL Server used by the .| +|BaseTableName|The name of the table or view in the data store that contains the column. A null value if the base table name cannot be determined. The default of this column is a null value.| +|ColumnName|The name of the column; this might not be unique. If this cannot be determined, a null value is returned. This name always reflects the most recent renaming of the column in the current view or command text.| +|ColumnOrdinal|The zero-based ordinal of the column. This column cannot contain a null value.| |ColumnSize|The maximum possible length of a value in the column. For columns that use a fixed-length data type, this is the size of the data type. For `nvarchar(MAX)`, `varchar(MAX)`, and `varbinary(MAX)` columns stored in a SQL Server database, the maximum size is 2GB. If these columns are stored and accessed as files, the limit on maximum size is imposed by the file system. This value changes when using the `Type System Version` keyword in the connection string. For new types they are represented as downlevel types. The MAX data types return the normal 4k for `nvarchar` and 8000 for `varchar`. For more information, see the [Transact-SQL reference](/sql/t-sql/language-reference).| -|DataTypeName|Returns a string representing the data type of the specified column.| -|IsAliased|`true`: The column name is an alias.

`false`: The column name is not an alias.| -|IsAutoIncrement|`true`: The column assigns values to new rows in fixed increments.

`false`: The column does not assign values to new rows in fixed increments. The default of this column is `false`.| -|IsColumnSet|`true`: The column is a sparse column that is a member of a column set.| -|IsExpression|`true`: The column is an expression.

`false`: The column is not an expression.| -|IsHidden|`true`: The column is hidden.

`false`: The column is not hidden.| -|IsIdentity|`true`: The column is an identity column.

`false`: The column is not an identity column.| -|IsKey|`true`: The column is one of a set of columns in the rowset that, taken together, uniquely identify the row. The set of columns with `IsKey` set to `true` must uniquely identify a row in the rowset. There is no requirement that this set of columns is a minimal set of columns. This set of columns may be generated from a base table primary key, a unique constraint or a unique index.

`false`: The column is not required to uniquely identify the row.| -|IsLong|`true`: The column contains a Binary Long Object (BLOB) that contains very long data. The definition of very long data is provider-specific.

`false`: The column does not contain a Binary Long Object (BLOB) that contains very long data.| -|IsReadOnly|`true`: The column cannot be modified.

`false`: The column can be modified.| -|IsRowVersion|`true`: The column contains a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.

`false`: The column does not contain a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.| -|IsUnique|`true`: Column is of type `timestamp`.

`false`: Column is not of type `timestamp`.| -|NonVersionedProviderType|The type of the column irrespective of the current `Type System Version` specified in the connection string. The returned value is from the enumeration.| -|NumericPrecision|If `ProviderType` is a numeric data type, this is the maximum precision of the column. The precision depends on the definition of the column. If `ProviderType` is not a numeric data type, this is 255.| -|NumericScale|If `ProviderType` is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is 255.| -|ProviderSpecificDataType|Returns the provider-specific data type of the column based on the `Type System Version` keyword in the connection string.| -|ProviderType|The indicator of the column's data type. If the data type of the column varies from row to row, this must be Object. This column cannot contain a null value.| -|UdtAssemblyQualifiedName|If the column is a user-defined type (UDT), this is the qualified name of the UDT's assembly as per . If the column is not a UDT, this is null.| -|XmlSchemaCollectionDatabase|The name of the database where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionName` and `XmlSchemaCollectionOwningSchema` columns are also null.| -|XmlSchemaCollectionName|The name of the schema collection for this XML instance, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if there is no associated schema collection. If the value is null, the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionOwningSchema` columns are also null.| -|XmlSchemaCollectionOwningSchema|The owning relational schema where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionName` columns are also null.| - +|DataTypeName|Returns a string representing the data type of the specified column.| +|IsAliased|`true`: The column name is an alias.

`false`: The column name is not an alias.| +|IsAutoIncrement|`true`: The column assigns values to new rows in fixed increments.

`false`: The column does not assign values to new rows in fixed increments. The default of this column is `false`.| +|IsColumnSet|`true`: The column is a sparse column that is a member of a column set.| +|IsExpression|`true`: The column is an expression.

`false`: The column is not an expression.| +|IsHidden|`true`: The column is hidden.

`false`: The column is not hidden.| +|IsIdentity|`true`: The column is an identity column.

`false`: The column is not an identity column.| +|IsKey|`true`: The column is one of a set of columns in the rowset that, taken together, uniquely identify the row. The set of columns with `IsKey` set to `true` must uniquely identify a row in the rowset. There is no requirement that this set of columns is a minimal set of columns. This set of columns may be generated from a base table primary key, a unique constraint or a unique index.

`false`: The column is not required to uniquely identify the row.| +|IsLong|`true`: The column contains a Binary Long Object (BLOB) that contains very long data. The definition of very long data is provider-specific.

`false`: The column does not contain a Binary Long Object (BLOB) that contains very long data.| +|IsReadOnly|`true`: The column cannot be modified.

`false`: The column can be modified.| +|IsRowVersion|`true`: The column contains a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.

`false`: The column does not contain a persistent row identifier that cannot be written to, and has no meaningful value except to identity the row.| +|IsUnique|`true`: Column is of type `timestamp`.

`false`: Column is not of type `timestamp`.| +|NonVersionedProviderType|The type of the column irrespective of the current `Type System Version` specified in the connection string. The returned value is from the enumeration.| +|NumericPrecision|If `ProviderType` is a numeric data type, this is the maximum precision of the column. The precision depends on the definition of the column. If `ProviderType` is not a numeric data type, this is 255.| +|NumericScale|If `ProviderType` is DBTYPE_DECIMAL or DBTYPE_NUMERIC, the number of digits to the right of the decimal point. Otherwise, this is 255.| +|ProviderSpecificDataType|Returns the provider-specific data type of the column based on the `Type System Version` keyword in the connection string.| +|ProviderType|The indicator of the column's data type. If the data type of the column varies from row to row, this must be Object. This column cannot contain a null value.| +|UdtAssemblyQualifiedName|If the column is a user-defined type (UDT), this is the qualified name of the UDT's assembly as per . If the column is not a UDT, this is null.| +|XmlSchemaCollectionDatabase|The name of the database where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionName` and `XmlSchemaCollectionOwningSchema` columns are also null.| +|XmlSchemaCollectionName|The name of the schema collection for this XML instance, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if there is no associated schema collection. If the value is null, the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionOwningSchema` columns are also null.| +|XmlSchemaCollectionOwningSchema|The owning relational schema where the schema collection for this XML instance is located, if the row contains information about an XML column. This value is `null` (`Nothing` in Visual Basic) if the collection is defined within the current database. It is also null if there is no schema collection, in which case the `XmlSchemaCollectionDatabase` and `XmlSchemaCollectionName` columns are also null.| + > [!NOTE] -> To make sure that metadata columns return the correct information, you must call with the `behavior` parameter set to `KeyInfo`. Otherwise, some of the columns in the schema table may return default, null, or incorrect data. - +> To make sure that metadata columns return the correct information, you must call with the `behavior` parameter set to `KeyInfo`. Otherwise, some of the columns in the schema table may return default, null, or incorrect data. + ]]>
The is closed. @@ -1859,11 +1843,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -1912,11 +1896,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column. - SQL Server Data Types and ADO.NET @@ -1965,11 +1949,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2098,11 +2082,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2151,11 +2135,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2204,11 +2188,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2257,11 +2241,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2310,11 +2294,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2363,11 +2347,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2416,11 +2400,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2469,11 +2453,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2522,11 +2506,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2575,11 +2559,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a . The value of the column expressed as a . - SQL Server Data Types and ADO.NET @@ -2628,11 +2612,11 @@ This member is an explicit interface member implementation. It can be used only Returns the data value in the specified column as a SQL Server type. The value of the column expressed as a . - returns data using the native SQL Server types. To retrieve data using the .NET Framework types, see . - + returns data using the native SQL Server types. To retrieve data using the .NET Framework types, see . + ]]> SQL Server Data Types and ADO.NET @@ -2681,11 +2665,11 @@ This member is an explicit interface member implementation. It can be used only Fills an array of that contains the values for all the columns in the record, expressed as SQL Server types. An integer indicating the number of columns copied. - array does not need to match the number of columns in the record. You can pass an array that contains fewer than the number of columns contained in the record. Only the amount of data the array holds is copied to the array, starting at the column with ordinal 0. You can also pass an array whose length is more than the number of columns contained in the resulting row. Any remaining columns are untouched. - + array does not need to match the number of columns in the record. You can pass an array that contains fewer than the number of columns contained in the record. Only the amount of data the array holds is copied to the array, starting at the column with ordinal 0. You can also pass an array whose length is more than the number of columns contained in the resulting row. Any remaining columns are untouched. + ]]> @@ -2730,13 +2714,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as an XML value. A value that contains the XML stored within the corresponding field. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The index passed was outside the range of 0 to - 1 @@ -2781,62 +2765,59 @@ This member is an explicit interface member implementation. It can be used only Retrieves binary, image, varbinary, UDT, and variant data types as a . A stream object. - defaults to the value of ; but you can modify via . - - Null values will be returned as an empty (zero bytes) . - - will raise an exception when used on an object returned by when is in effect. - - exceptions raised from are thrown as exceptions; check the inner exception for the . - - The following members are not available for objects returned by : - -- BeginWrite - -- EndWrite - -- Length - -- Position - -- Seek - -- SetLength - -- Write - -- WriteByte - -- WriteTimeout - - When the connection property `ContextConnection=true`, only supports synchronous data retrieval for both sequential () and non-sequential () access. - - For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). - + defaults to the value of ; but you can modify via . + + Null values will be returned as an empty (zero bytes) . + + will raise an exception when used on an object returned by when is in effect. + + exceptions raised from are thrown as exceptions; check the inner exception for the . + + The following members are not available for objects returned by : + +- BeginWrite + +- EndWrite + +- Length + +- Position + +- Seek + +- SetLength + +- Write + +- WriteByte + +- WriteTimeout + + When the connection property `ContextConnection=true`, only supports synchronous data retrieval for both sequential () and non-sequential () access. + + For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). + ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Tried to read a previously-read column in sequential mode. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Tried to read a previously-read column in sequential mode. + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. Trying to read a column that does not exist. - The returned type was not one of the types below: - -- binary - -- image - -- varbinary - -- udt + The returned type was not one of the types below: + +- binary +- image +- varbinary +- udt
@@ -2883,13 +2864,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column as a string. The value of the specified column. - to check for null values before calling this method. - + to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -2932,43 +2913,43 @@ This member is an explicit interface member implementation. It can be used only Retrieves Char, NChar, NText, NVarChar, text, varChar, and Variant data types as a . The returned object. - exceptions raised from are thrown as exceptions; check the inner exception for the . - - Null values will be returned as an empty (zero bytes) . - - will raise an exception when used on an object returned by when is in effect. - - When the connection property `ContextConnection=true`, only supports synchronous data retrieval for both sequential () and non-sequential () access. - - For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). - + exceptions raised from are thrown as exceptions; check the inner exception for the . + + Null values will be returned as an empty (zero bytes) . + + will raise an exception when used on an object returned by when is in effect. + + When the connection property `ContextConnection=true`, only supports synchronous data retrieval for both sequential () and non-sequential () access. + + For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). + ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Tried to read a previously-read column in sequential mode. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Tried to read a previously-read column in sequential mode. + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. Trying to read a column that does not exist. - The returned type was not one of the types below: - -- char - -- nchar - -- ntext - -- nvarchar - -- text - + The returned type was not one of the types below: + +- char + +- nchar + +- ntext + +- nvarchar + +- text + - varchar
@@ -3007,13 +2988,13 @@ This member is an explicit interface member implementation. It can be used only Retrieves the value of the specified column as a object. The value of the specified column. - object. - - Call to check for null values before calling this method. - + object. + + Call to check for null values before calling this method. + ]]> The specified cast is not valid. @@ -3066,11 +3047,11 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column in its native format. This method returns for null database columns. - returns data using the .NET Framework types. - + returns data using the .NET Framework types. + ]]> SQL Server Data Types and ADO.NET @@ -3122,23 +3103,23 @@ This member is an explicit interface member implementation. It can be used only Populates an array of objects with the column values of the current row. The number of instances of in the array. - array that contains fewer than the number of columns contained in the resulting row. Only the amount of data the array holds is copied to the array. You can also pass an array whose length is more than the number of columns contained in the resulting row. - - This method returns for null database columns. - - - -## Examples - The following example demonstrates using a correctly sized array to read all values from the current row in the supplied . In addition, the sample demonstrates using a fixed-sized array that could be either smaller or larger than the number of available columns. - + array that contains fewer than the number of columns contained in the resulting row. Only the amount of data the array holds is copied to the array. You can also pass an array whose length is more than the number of columns contained in the resulting row. + + This method returns for null database columns. + + + +## Examples + The following example demonstrates using a correctly sized array to read all values from the current row in the supplied . In addition, the sample demonstrates using a fixed-sized array that could be either smaller or larger than the number of available columns. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/CS/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks DataTableReader.GetValueObject/VB/source.vb" id="Snippet2"::: + ]]> SQL Server Data Types and ADO.NET @@ -3180,27 +3161,27 @@ This member is an explicit interface member implementation. It can be used only Retrieves data of type XML as an . The returned object. - object returned by does not support asynchronous operations. If you require asynchronous operations on an , cast the XML column to an NVARCHAR(MAX) on the server and use with . - - exceptions raised from are thrown as exceptions; check the inner exception for the . - - will raise an exception when used on an object returned by when is in effect. - - For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). - + object returned by does not support asynchronous operations. If you require asynchronous operations on an , cast the XML column to an NVARCHAR(MAX) on the server and use with . + + exceptions raised from are thrown as exceptions; check the inner exception for the . + + will raise an exception when used on an object returned by when is in effect. + + For more information, see [SqlClient Streaming Support](/dotnet/framework/data/adonet/sqlclient-streaming-support). + ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Trying to read a previously read column in sequential mode. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Trying to read a previously read column in sequential mode. + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. Trying to read a column that does not exist. The returned type was not xml. @@ -3284,11 +3265,11 @@ This member is an explicit interface member implementation. It can be used only if the specified instance is closed; otherwise . - instance that is closed. - + instance that is closed. + ]]> SQL Server Connection Pooling (ADO.NET) @@ -3330,11 +3311,11 @@ This member is an explicit interface member implementation. It can be used only if the specified is true, otherwise. - ADO.NET Overview @@ -3384,14 +3365,14 @@ This member is an explicit interface member implementation. It can be used only if the specified column value is equivalent to ; otherwise . - , , and so on) to avoid raising an error. - + , , and so on) to avoid raising an error. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/sqldatareader_isdbnull/cs/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/sqldatareader_isdbnull/vb/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/sqldatareader_isdbnull/vb/source.vb" id="Snippet1"::: + ]]> DataAdapters and DataReaders (ADO.NET) @@ -3431,31 +3412,31 @@ This member is an explicit interface member implementation. It can be used only The zero-based column to be retrieved. The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of makes this method equivalent to . The returned task must be marked as cancelled. - An asynchronous version of , which gets a value that indicates whether the column contains non-existent or missing values. - + An asynchronous version of , which gets a value that indicates whether the column contains non-existent or missing values. + The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object. if the specified column value is equivalent to otherwise . - , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> - The connection drops or is closed during the data retrieval. - - The is closed during the data retrieval. - - There is no data ready to be read (for example, the first hasn't been called, or returned false). - - Trying to read a previously read column in sequential mode. - - There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - + The connection drops or is closed during the data retrieval. + + The is closed during the data retrieval. + + There is no data ready to be read (for example, the first hasn't been called, or returned false). + + Trying to read a previously read column in sequential mode. + + There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. + is specified in the connection string. Trying to read a column that does not exist. The cancellation token was canceled. This exception is stored into the returned task. @@ -3559,13 +3540,13 @@ This member is an explicit interface member implementation. It can be used only Gets the value of the specified column in its native format given the column name. The value of the specified column in its native format. - No column with the specified name was found. @@ -3615,13 +3596,13 @@ This member is an explicit interface member implementation. It can be used only if there are more result sets; otherwise . - DataAdapters and DataReaders (ADO.NET) @@ -3658,22 +3639,22 @@ This member is an explicit interface member implementation. It can be used only The cancellation instruction. - An asynchronous version of , which advances the data reader to the next result, when reading the results of batch Transact-SQL statements. - + An asynchronous version of , which advances the data reader to the next result, when reading the results of batch Transact-SQL statements. + The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object. A task representing the asynchronous operation. - , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> - Calling more than once for the same instance before task completion. - + Calling more than once for the same instance before task completion. + is specified in the connection string. SQL Server returned an error while executing the command text. ADO.NET Overview @@ -3721,21 +3702,21 @@ This member is an explicit interface member implementation. It can be used only if there are more rows; otherwise . - is before the first record. Therefore, you must call to begin accessing any data. - - Only one `SqlDataReader` per associated may be open at a time, and any attempt to open another will fail until the first one is closed. Similarly, while the `SqlDataReader` is being used, the associated `SqlConnection` is busy serving it until you call . - - - -## Examples - The following example creates a , a , and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. - + is before the first record. Therefore, you must call to begin accessing any data. + + Only one `SqlDataReader` per associated may be open at a time, and any attempt to open another will fail until the first one is closed. Similarly, while the `SqlDataReader` is being used, the associated `SqlConnection` is busy serving it until you call . + + + +## Examples + The following example creates a , a , and a . The example reads through the data, writing it out to the console window. The code then closes the . The is closed automatically at the end of the `using` code block. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/CS/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_ADO.NET/Classic WebData SqlDataReader.Read Example/VB/source.vb" id="Snippet1"::: + ]]> SQL Server returned an error while executing the command text. @@ -3774,24 +3755,24 @@ This member is an explicit interface member implementation. It can be used only The cancellation instruction. - An asynchronous version of , which advances the to the next record. - + An asynchronous version of , which advances the to the next record. + The cancellation token can be used to request that the operation be abandoned before the command timeout elapses. Exceptions will be reported via the returned Task object. A task representing the asynchronous operation. - is set to `Default`, reads the entire row before returning the Task. - - For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/dotnet/framework/data/adonet/asynchronous-programming). - + is set to `Default`, reads the entire row before returning the Task. + + For more information, including code samples, about asynchronous programming in the .NET Framework Data Provider for SQL Server, see [Asynchronous Programming](/dotnet/framework/data/adonet/asynchronous-programming). + This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . ]]> - Calling more than once for the same instance before task completion. - + Calling more than once for the same instance before task completion. + is specified in the connection string. SQL Server returned an error while executing the command text. ADO.NET Overview @@ -3835,13 +3816,13 @@ This member is an explicit interface member implementation. It can be used only Gets the number of rows changed, inserted, or deleted by execution of the Transact-SQL statement. The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements. - and are the only properties that you can call after the is closed. - + and are the only properties that you can call after the is closed. + ]]> SQL Server Connection Pooling (ADO.NET) @@ -3922,11 +3903,11 @@ This member is an explicit interface member implementation. It can be used only Returns an for the specified column ordinal. The instance for the specified column ordinal. - instance is cast to an interface. - + instance is cast to an interface. + ]]> ADO.NET Overview @@ -3997,11 +3978,11 @@ This member is an explicit interface member implementation. It can be used only Gets the number of fields in the that are not hidden. The number of fields that are not hidden. - are visible. For example, a SELECT on a partial primary key returns the remaining parts of the key as hidden fields. The hidden fields are always appended behind the visible fields. - + are visible. For example, a SELECT on a partial primary key returns the remaining parts of the key as hidden fields. The hidden fields are always appended behind the visible fields. + ]]> DataAdapters and DataReaders (ADO.NET) diff --git a/xml/System.IO.Packaging/PackageDigitalSignature.xml b/xml/System.IO.Packaging/PackageDigitalSignature.xml index d7b2f90fc14..490615abff3 100644 --- a/xml/System.IO.Packaging/PackageDigitalSignature.xml +++ b/xml/System.IO.Packaging/PackageDigitalSignature.xml @@ -22,19 +22,19 @@ Represents a digital signature that is applied to a set of package parts and relationships. - object is immutable and cannot be altered after it is created. - - For security, a can be associated with parts within a . A incorporates an X.509 certificate that provides two features: - -- Identifies and authenticates the originator of the part. - -- Validates that the part has not been modified. - + object is immutable and cannot be altered after it is created. + + For security, a can be associated with parts within a . A incorporates an X.509 certificate that provides two features: + +- Identifies and authenticates the originator of the part. + +- Validates that the part has not been modified. + The digital signature does not preclude a part from being modified, but a validation check against the signature fails if the part has changed in any way. The application can then take appropriate action - for example, it can prevent the part from opening or it can notify the user that the part has been modified and is not secure. - + ]]> @@ -67,17 +67,17 @@ Gets the X.509 certificate embedding option. One of the values that specifies the option for the digital signature. - |In its own certificate in the package.

The X.509 certificate can be obtained through the property.| -||Within the content of the in the package.

The X.509 certificate can be obtained through the property.| -||External to the package in a location known by both the application that creates the signature and the application that later uses the signature for validation.| - + |In its own certificate in the package.

The X.509 certificate can be obtained through the property.| +||Within the content of the in the package.

The X.509 certificate can be obtained through the property.| +||External to the package in a location known by both the application that creates the signature and the application that later uses the signature for validation.| + ]]>
The digital has been deleted. @@ -142,11 +142,11 @@ Gets or sets the XML digital signature. The XML digital signature. - provides access to the foundation class that performs type-specific signature cryptographic functions and serialization to and from the that hosts the signature. - + provides access to the foundation class that performs type-specific signature cryptographic functions and serialization to and from the that hosts the signature. + ]]> The digital has been deleted. @@ -177,11 +177,11 @@ Gets the that contains the signature. The package part that contains the signature. - The digital has been deleted. @@ -327,13 +327,13 @@ Gets the X.509 certificate of the signer. The digital certificate of the signer, or if the certificate is not stored in the . - returns the X.509 certificate of the signer when the digital certificate is stored within the package (that is, when is or ). - - returns `null` when the X.509 certificate is not stored in the package (that is, when is ). - + returns the X.509 certificate of the signer when the digital certificate is stored within the package (that is, when is or ). + + returns `null` when the X.509 certificate is not stored in the package (that is, when is ). + ]]> The digital has been deleted. @@ -364,15 +364,15 @@ Gets the date and time that the signature was created. The date and time that the signature was created. - property specifies the format of the date. The format of the string is based on the property in effect when the signature was created. - - is based on the system time of the computer where the signing took place. - - is not a "secure TimeStamp" and is not from trusted Time Stamp Authority. A secure TimeStamp must be obtained and applied through a trusted Time Stamp Authority. - + property specifies the format of the date. The format of the string is based on the property in effect when the signature was created. + + is based on the system time of the computer where the signing took place. + + is not a "secure TimeStamp" and is not from trusted Time Stamp Authority. A secure TimeStamp must be obtained and applied through a trusted Time Stamp Authority. + ]]> The digital has been deleted. @@ -404,33 +404,33 @@ Gets the format of the date and time returned by the property. The format of the date and time returned by the property. - The digital has been deleted. @@ -473,11 +473,11 @@ if the verification succeeded; otherwise, one of the values that identifies a problem. - . - + . + ]]> The digital has been deleted. diff --git a/xml/System.IO.Packaging/PackageRelationship.xml b/xml/System.IO.Packaging/PackageRelationship.xml index ed6a6baf54a..07fe1abf6ab 100644 --- a/xml/System.IO.Packaging/PackageRelationship.xml +++ b/xml/System.IO.Packaging/PackageRelationship.xml @@ -44,28 +44,28 @@ Represents an association between a source or , and a target object which can be a or external resource. - defines an association between a *source* or to a *target* or external resource. The source object is considered the "owner" of the relationship. - - The class has no public constructor; instead, two Create methods are used: - -||| -|-|-| -|.|Creates a "package-level" relationship-from a package to a specified part or external resource.| -|.|Creates a "part-level" relationship-from one part to another part or external resource.| - - The source package or part is identified by the property of the relationship. The target part or external resource is identified by the property of the relationship. - - Creating or deleting a relationship does not affect the source or target objects in any way. - - If a source object is deleted, all relationships owned by the object are also deleted. - - Relationships enable navigation both in a document and between documents. Relationships also support document object model services, such as linking a to specific document elements when printing. - - For more information about elements see Section 1.3 "Relationships" in the *Open Packaging Conventions* specification available for download at . - + defines an association between a *source* or to a *target* or external resource. The source object is considered the "owner" of the relationship. + + The class has no public constructor; instead, two `Create` methods are used: + +| `Create` method | Description | +|-|-| +|.|Creates a "package-level" relationship-from a package to a specified part or external resource.| +|.|Creates a "part-level" relationship-from one part to another part or external resource.| + + The source package or part is identified by the property of the relationship. The target part or external resource is identified by the property of the relationship. + + Creating or deleting a relationship does not affect the source or target objects in any way. + + If a source object is deleted, all relationships owned by the object are also deleted. + + Relationships enable navigation both in a document and between documents. Relationships also support document object model services, such as linking a to specific document elements when printing. + + For more information about elements see Section 1.3 "Relationships" in the *Open Packaging Conventions* specification available for download at . + ]]> @@ -107,15 +107,15 @@ Gets a string that identifies the relationship. A string that identifies the relationship. - property string is unique for all relationships owned by the package or part. - - The is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created, the cannot be changed. - - The property string is a valid XML identifier. The type is xsd:ID and must follow the naming conventions prescribed in the *XML Schema Part 2: Datatypes* specification (see [https://www.w3.org/TR/xmlschema-2/#ID](https://www.w3.org/TR/xmlschema-2/#ID)). - + property string is unique for all relationships owned by the package or part. + + The is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created, the cannot be changed. + + The property string is a valid XML identifier. The type is xsd:ID and must follow the naming conventions prescribed in the *XML Schema Part 2: Datatypes* specification (see [https://www.w3.org/TR/xmlschema-2/#ID](https://www.w3.org/TR/xmlschema-2/#ID)). + ]]> @@ -160,11 +160,11 @@ Gets the that contains this relationship. The package that contains this relationship. - elements see the *Open Packaging Conventions* at . - + elements see the *Open Packaging Conventions* at . + ]]>
@@ -206,25 +206,25 @@ Gets the qualified type name of the relationship. The qualified type name of the relationship. - is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created, the cannot be changed. - - is defined in a URI-like syntax and identifies the role of the relationship. For example, `"http://schemas.microsoft.com/xps/2005/06/required-resource"` identifies the relationship to a target part that is a "required-resource." - - **Package-Wide Relationship Types** - -|Description|Relationship Type| -|-----------------|-----------------------| -|Core Properties|`http://schemas.microsoft.com/package/2006/relationships/metadata/core-properties`| -|Digital Signature|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/signature`| -|Digital Signature Certificate|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/certificate`| -|Digital Signature Origin|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/origin`| -|Thumbnail|`http://schemas.microsoft.com/package/2006/relationships/metadata/thumbnail`| - - For more information about package relationship types see Chapter 3 and Appendix I of the *Open Packaging Conventions* specification available for download at . - + is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created, the cannot be changed. + + is defined in a URI-like syntax and identifies the role of the relationship. For example, `"http://schemas.microsoft.com/xps/2005/06/required-resource"` identifies the relationship to a target part that is a "required-resource." + + **Package-Wide Relationship Types** + +|Description|Relationship Type| +|-----------------|-----------------------| +|Core Properties|`http://schemas.microsoft.com/package/2006/relationships/metadata/core-properties`| +|Digital Signature|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/signature`| +|Digital Signature Certificate|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/certificate`| +|Digital Signature Origin|`http://schemas.microsoft.com/package/2006/relationships/digital-signature/origin`| +|Thumbnail|`http://schemas.microsoft.com/package/2006/relationships/metadata/thumbnail`| + + For more information about package relationship types see Chapter 3 and Appendix I of the *Open Packaging Conventions* specification available for download at . + ]]> @@ -261,13 +261,13 @@ Gets the URI of the package or part that owns the relationship. The URI of the or that owns the relationship. - , returns a URI of "/". - - If the relationship is owned by a , returns the URI of the part. - + , returns a URI of "/". + + If the relationship is owned by a , returns the URI of the part. + ]]> @@ -310,17 +310,17 @@ Gets a value that indicates whether the target of the relationship is or to the . An enumeration value that indicates whether references a resource or to the . - is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created the cannot be changed. - - When is , the MUST be a relative reference. For a package-level relationship, the relative reference of the is resolved relative to the pack URI of the source package that owns and contains the relationship. (Example source package pack URI: "pack://http:,,www.adatum.com,files,datapak.package/".) For a part-level relationship, the is resolved relative to the source part that owns the relationship ( is interpreted relative to ). - - When is , the can be either a relative reference or a fully qualified URI. If the is a relative reference, the reference is interpreted as relative to the location of the that contains this relationship. - - For more information about see Section 1.3.3 "Relationship Markup" of the *Open Packaging Conventions* specification available for download at . - + is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created the cannot be changed. + + When is , the MUST be a relative reference. For a package-level relationship, the relative reference of the is resolved relative to the pack URI of the source package that owns and contains the relationship. (Example source package pack URI: "pack://http:,,www.adatum.com,files,datapak.package/".) For a part-level relationship, the is resolved relative to the source part that owns the relationship ( is interpreted relative to ). + + When is , the can be either a relative reference or a fully qualified URI. If the is a relative reference, the reference is interpreted as relative to the location of the that contains this relationship. + + For more information about see Section 1.3.3 "Relationship Markup" of the *Open Packaging Conventions* specification available for download at . + ]]> @@ -364,17 +364,17 @@ Gets the URI of the target resource of the relationship. The URI of the target resource. - is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created the cannot be changed. - - When is , the MUST be a relative reference. For a package-level relationship, the relative reference of the is resolved relative to the pack URI of the source package that owns and contains the relationship. (Example source package pack URI: "pack://http:,,www.adatum.com,files,datapak.package/".) For a part-level relationship, the is resolved relative to the source part that owns the relationship ( is interpreted relative to ). - - When is , the can be either a relative reference or a fully qualified URI. If the is a relative reference, the reference is interpreted as relative to the location of the that contains this relationship. - - For more information about see Section 1.3.3 "Relationship Markup" of the *Open Packaging Conventions* specification available for download at . - + is specified in the call to the **Package**. or **PackagePart**. method that created the relationship. After the relationship is created the cannot be changed. + + When is , the MUST be a relative reference. For a package-level relationship, the relative reference of the is resolved relative to the pack URI of the source package that owns and contains the relationship. (Example source package pack URI: "pack://http:,,www.adatum.com,files,datapak.package/".) For a part-level relationship, the is resolved relative to the source part that owns the relationship ( is interpreted relative to ). + + When is , the can be either a relative reference or a fully qualified URI. If the is a relative reference, the reference is interpreted as relative to the location of the that contains this relationship. + + For more information about see Section 1.3.3 "Relationship Markup" of the *Open Packaging Conventions* specification available for download at . + ]]> diff --git a/xml/System.Numerics/BigInteger.xml b/xml/System.Numerics/BigInteger.xml index 2fa4685579a..5860f97f2ae 100644 --- a/xml/System.Numerics/BigInteger.xml +++ b/xml/System.Numerics/BigInteger.xml @@ -288,16 +288,17 @@ and , return byte arrays in little-endian order. - The constructor expects positive values in the byte array to use sign-and-magnitude representation, and negative values to use two's complement representation. In other words, if the highest-order bit of the highest-order byte in `value` is set, the resulting value is negative. Depending on the source of the byte array, this may cause a positive value to be misinterpreted as a negative value. Byte arrays are typically generated in the following ways: + The constructor expects positive values in the byte array to use sign-and-magnitude representation, and negative values to use two's complement representation. In other words, if the highest-order bit of the highest-order byte in `value` is set, the resulting value is negative. Depending on the source of the byte array, this might cause a positive value to be misinterpreted as a negative value. Byte arrays are typically generated in the following ways: - By calling the method. Because this method returns a byte array with the highest-order bit of the highest-order byte in the array set to zero for positive values, there is no chance of misinterpreting a positive value as negative. Unmodified byte arrays created by the method always successfully round-trip when they are passed to the constructor. @@ -309,8 +310,6 @@ If `value` is an empty array, the new object is initialized to a value of . If `value` is `null`, the constructor throws an . - - ## Examples The following example instantiates a object from a 5-element byte array whose value is {5, 4, 3, 2, 1}. It then displays the value, represented as both decimal and hexadecimal numbers, to the console. A comparison of the input array with the text output makes it clear why this overload of the class constructor creates a object whose value is 4328719365 (or 0x102030405). The first element of the byte array, whose value is 5, defines the value of the lowest-order byte of the object, which is 0x05. The second element of the byte array, whose value is 4, defines the value of the second byte of the object, which is 0x04, and so on. diff --git a/xml/System.Security.Cryptography/PaddingMode.xml b/xml/System.Security.Cryptography/PaddingMode.xml index 2ecdfd87c7e..76e786429c0 100644 --- a/xml/System.Security.Cryptography/PaddingMode.xml +++ b/xml/System.Security.Cryptography/PaddingMode.xml @@ -59,19 +59,18 @@ Specifies the type of padding to apply when the message data block is shorter than the full number of bytes needed for a cryptographic operation. - diff --git a/xml/System.Text.RegularExpressions/Match.xml b/xml/System.Text.RegularExpressions/Match.xml index 7d894291668..b099c7ae951 100644 --- a/xml/System.Text.RegularExpressions/Match.xml +++ b/xml/System.Text.RegularExpressions/Match.xml @@ -74,21 +74,20 @@ Because a single match can involve multiple capturing groups, has a property that returns the . The instance itself is equivalent to the first object in the collection, at `Match.Groups[0]` (`Match.Groups(0)` in Visual Basic), which represents the entire match. You can access the captured groups in a match in the following ways: -- You can iterate the members of the object by using a `foreach` (C#) or `For Each` (Visual Basic) construct. - -- You can use the property to retrieve groups by the number of the capturing group. Note that you can determine which numbered groups are present in a regular expression by calling the instance method. - -- You can use the property to retrieve groups by the name of the capturing group. Note that you can determine which named groups are present in a regular expression by calling the instance method. +- You can iterate the members of the object by using a `foreach` (C#) or `For Each` (Visual Basic) construct. +- You can use the property to retrieve groups by the number of the capturing group. Note that you can determine which numbered groups are present in a regular expression by calling the instance method. +- You can use the property to retrieve groups by the name of the capturing group. Note that you can determine which named groups are present in a regular expression by calling the instance method. ## Examples - The following examples use the regular expression `Console\.Write(Line)?`. The regular expression is interpreted as follows: -||| -|-|-| -|Console\\.Write|Match the string "Console.Write". Note that the "." character is escaped so that it is interpreted as a literal period rather than as a wildcard that matches any character.| -|(Line)?|Match zero or one occurrence of the string "Line".| +The following examples use the regular expression `Console\.Write(Line)?`. The regular expression is interpreted as follows: + +| Pattern | Description | +|------------------|----------------------------------------------------| +| `Console\.Write` | Match the string "Console.Write". (The "." character is escaped so that it's interpreted as a literal period rather than as a wildcard that matches any character.) | +| `(Line)?` | Match zero or one occurrence of the string "Line". | **Example 1** diff --git a/xml/System.Text.RegularExpressions/Regex.xml b/xml/System.Text.RegularExpressions/Regex.xml index aee84aace9e..763ec9b492d 100644 --- a/xml/System.Text.RegularExpressions/Regex.xml +++ b/xml/System.Text.RegularExpressions/Regex.xml @@ -4238,8 +4238,6 @@ For more details about `startat`, see the Remarks section of method does not throw a exception. However, the exception is thrown when an operation is performed on the object returned by this method, if the property is not and a matching operation exceeds the time-out interval. - - ## Examples The following example uses the method to identify any words in a sentence that end in "es". @@ -4248,12 +4246,12 @@ For more details about `startat`, see the Remarks section of diff --git a/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml b/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml index b842e5c3f13..b251b2e5413 100644 --- a/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml +++ b/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml @@ -16,21 +16,21 @@ Encodes a string for use in HTML, XML, CSS, and URL strings. - class to override the class that is used by default to encode and decode strings in methods of classes such as , , and . - - In the class, all characters that are not found in the safe list are encoded by the and methods. - - To replace the class with the class, register it using the `encoderType` attribute of the httpRuntime element in the Web.config file, as shown in following example: - -``` - -``` - - A list of default safe characters for different encoding methods can be found in the remarks for the , , , and methods. The default safe list can be modified by using the method. - + class to override the class that is used by default to encode and decode strings in methods of classes such as , , and . + + In the class, all characters that are not found in the safe list are encoded by the and methods. + + To replace the class with the class, register it using the `encoderType` attribute of the httpRuntime element in the Web.config file, as shown in following example: + +``` + +``` + + A list of default safe characters for different encoding methods can be found in the remarks for the , , , and methods. The default safe list can be modified by using the method. + ]]> @@ -75,32 +75,32 @@ Encodes the specified string for use in cascading style sheets (CSS). The encoded string. - [!NOTE] -> Put quotation marks (" ") around the resulting string before you add it to a cascading style sheet. - +> Put quotation marks (" ") around the resulting string before you add it to a cascading style sheet. + The following table lists the default safe characters. All are from the [Unicode C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase alphabetic characters| -|a-z|Lowercase alphabetic characters| -|0-9|Numbers| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert\000028\000027XSS\000020Attack\000021\000027\000029\00003B`| -|`user@contoso.com`|`user\000040contoso\00002Ecom`| -|`Anti-Cross Site Scripting Namespace`|`Anti\00002DCross\000020Site\000020Scripting\000020Namespace`| - - The CSS character escape sequence consists of a backslash character (\\) followed by up to six hexadecimal digits that represent a character code from the ISO 10646 standard. (The ISO 10646 standard is effectively equivalent to Unicode.) Any character other than a hexadecimal digit terminates the escape sequence. If a character that follows the escape sequence is also a valid hexadecimal digit, it must either include six digits in the escape sequence or use a white-space character to terminate the escape sequence. For example, `\000020` denotes a space. - + +|Character type|Description| +|--------------------|-----------------| +|A-Z|Uppercase alphabetic characters| +|a-z|Lowercase alphabetic characters| +|0-9|Numbers| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|---------------------------------------|-------------------------------------------------------------------| +| `alert('XSS Attack!');` | `alert\000028\000027XSS\000020Attack\000021\000027\000029\00003B` | +| `user@contoso.com` | `user\000040contoso\00002Ecom` | +| `Anti-Cross Site Scripting Namespace` | `Anti\00002DCross\000020Site\000020Scripting\000020Namespace` | + + The CSS character escape sequence consists of a backslash character (\\) followed by up to six hexadecimal digits that represent a character code from the ISO 10646 standard. (The ISO 10646 standard is effectively equivalent to Unicode.) Any character other than a hexadecimal digit terminates the escape sequence. If a character that follows the escape sequence is also a valid hexadecimal digit, it must either include six digits in the escape sequence or use a white-space character to terminate the escape sequence. For example, `\000020` denotes a space. + ]]> @@ -129,65 +129,65 @@ The text writer to use to output the string. Encodes and outputs the specified string for use in an HTML attribute. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - - The following table lists the default safe characters. All are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase Latin alphabetic characters| -|a-z|Lowercase Latin alphabetic characters| -|0-9|Numbers| -|\!|Exclamation mark| -|\#|Number sign, hash| -|\$|Dollar sign| -|\%|Percent sign| -|( )|Parentheses| -|\*|Asterisk| -|\+|Plus sign| -|\,|Comma| -|\-|Hyphen, minus| -|\.|Period, dot, full stop| -|\/|Slash| -|\:|Colon| -|\;|Semicolon| -|\=|Equals sign| -|\?|Question mark| -|\@|Commercial at-sign| -|\[ \]|Square brackets| -|\\ |Backslash| -|\^|Caret| -|\_|Underscore| -|\`|Grave accent| -|\{ \}|Braces, curly brackets| -|\||Vertical line| -|\~|Tilde| -|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| -|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + + The following table lists the default safe characters. All are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase Latin alphabetic characters| +|a-z|Lowercase Latin alphabetic characters| +|0-9|Numbers| +|\!|Exclamation mark| +|\#|Number sign, hash| +|\$|Dollar sign| +|\%|Percent sign| +|( )|Parentheses| +|\*|Asterisk| +|\+|Plus sign| +|\,|Comma| +|\-|Hyphen, minus| +|\.|Period, dot, full stop| +|\/|Slash| +|\:|Colon| +|\;|Semicolon| +|\=|Equals sign| +|\?|Question mark| +|\@|Commercial at-sign| +|\[ \]|Square brackets| +|\\ |Backslash| +|\^|Caret| +|\_|Underscore| +|\`|Grave accent| +|\{ \}|Braces, curly brackets| +|\||Vertical line| +|\~|Tilde| +|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| +|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| |0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| -|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| -|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| +|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| +|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| |0x02B0 - 0x02FF|Characters between 0x02B0 (688 decimal) and 0x02FF (767 decimal). (The Unicode [Spacing Modifier Letters](https://www.unicode.org/charts/PDF/U02B0.pdf) character range.)| -|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| - - The following table lists examples of inputs and the corresponding encoded outputs. - -|Input examples| Encoded outputs| -|-|-| -|`alert('XSS Attack!');`|`alert('XSS Attack!');`| -|``|`<script>alert('XSS Attack!');</script>`| -|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| -|`user@contoso.com`|`user@contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| - - To customize the safe list, call the method. - +|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| + + The following table lists examples of inputs and the corresponding encoded outputs. + +|Input examples| Encoded outputs| +|-|-| +|`alert('XSS Attack!');`|`alert('XSS Attack!');`| +|``|`<script>alert('XSS Attack!');</script>`| +|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| +|`user@contoso.com`|`user@contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| + + To customize the safe list, call the method. + ]]> @@ -227,66 +227,66 @@ Encodes the specified string for use as text in HTML markup and optionally specifies whether to use HTML 4.0 named entities. The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase Latin alphabetic characters| -|a-z|Lowercase Latin alphabetic characters| -|0-9|Numbers| -|(Space)|Space| -|!|Exclamation mark| -|#|Number sign, hash| -|$|Dollar sign| -|%|Percent sign| -|( )|Parentheses| -|*|Asterisk| -|+|Plus sign| -|,|Comma| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|/|Slash| -|:|Colon| -|;|Semicolon| -|=|Equals sign| -|?|Question mark| -|@|Commercial at| -|[ ]|Square brackets| -|\|Backslash| -|^|Caret| -|_|Underscore| -|\`|Grave accent| -|{ }|Braces, curly brackets| -|||Vertical line| -|~|Tilde| -|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| -|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase Latin alphabetic characters| +|a-z|Lowercase Latin alphabetic characters| +|0-9|Numbers| +|(Space)|Space| +|!|Exclamation mark| +|#|Number sign, hash| +|$|Dollar sign| +|%|Percent sign| +|( )|Parentheses| +|*|Asterisk| +|+|Plus sign| +|,|Comma| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|/|Slash| +|:|Colon| +|;|Semicolon| +|=|Equals sign| +|?|Question mark| +|@|Commercial at| +|[ ]|Square brackets| +|\|Backslash| +|^|Caret| +|_|Underscore| +|\`|Grave accent| +|{ }|Braces, curly brackets| +|||Vertical line| +|~|Tilde| +|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| +|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| |0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| -|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| -|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| +|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| +|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| |0x02B0 - 0x02FF|Characters between 0x02B0 (688 decimal) and 0x02FF (767 decimal). (The Unicode [Spacing Modifier Letters](https://www.unicode.org/charts/PDF/U02B0.pdf) character range.)| -|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert('XSS Attack!');`| -|``|`<script>alert('XSS Attack!');</script>`| -|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| -|`user@contoso.com`|`user@contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| - - To customize the safe list, call the method. - +|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|------------------------------------------|---------------------------------------------------------------| +| `alert('XSS Attack!');` | `alert('XSS Attack!');` | +| `` | `<script>alert('XSS Attack!');</script>` | +| `alert('XSSあAttack!');` | `alert('XSSあAttack!');` | +| `user@contoso.com` | `user@contoso.com` | +| `"Anti-Cross Site Scripting Namespace"` | `"Anti-Cross Site Scripting Namespace"` | + + To customize the safe list, call the method. + ]]> @@ -315,66 +315,66 @@ The text writer to use to output the string. Encodes the specified string for use as text in HTML markup and outputs the string by using the specified text writer. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase Latin alphabetic characters| -|a-z|Lowercase Latin alphabetic characters| -|0-9|Numbers| -|(Space)|Space| -|!|Exclamation mark| -|#|Number sign, hash| -|$|Dollar sign| -|%|Percent sign| -|( )|Parentheses| -|*|Asterisk| -|+|Plus sign| -|,|Comma| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|/|Slash| -|:|Colon| -|;|Semicolon| -|=|Equals sign| -|?|Question mark| -|@|Commercial at| -|[ ]|Square brackets| -|\|Backslash| -|^|Caret| -|_|Underscore| -|\`|Grave accent| -|{ }|Braces, curly brackets| -|||Vertical line| -|~|Tilde| -|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| -|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase Latin alphabetic characters| +|a-z|Lowercase Latin alphabetic characters| +|0-9|Numbers| +|(Space)|Space| +|!|Exclamation mark| +|#|Number sign, hash| +|$|Dollar sign| +|%|Percent sign| +|( )|Parentheses| +|*|Asterisk| +|+|Plus sign| +|,|Comma| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|/|Slash| +|:|Colon| +|;|Semicolon| +|=|Equals sign| +|?|Question mark| +|@|Commercial at| +|[ ]|Square brackets| +|\|Backslash| +|^|Caret| +|_|Underscore| +|\`|Grave accent| +|{ }|Braces, curly brackets| +|||Vertical line| +|~|Tilde| +|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| +|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| |0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| -|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| -|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| +|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| +|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| |0x02B0 - 0x02FF|Characters between 0x02B0 (688 decimal) and 0x02FF (767 decimal). (The Unicode [Spacing Modifier Letters](https://www.unicode.org/charts/PDF/U02B0.pdf) character range.)| -|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert('XSS Attack!');`| -|``|`<script>alert('XSS Attack!');</script>`| -|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| -|`user@contoso.com`|`user@contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| - - To customize the safe list, call the method. - +|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert('XSS Attack!');`| +|``|`<script>alert('XSS Attack!');</script>`| +|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| +|`user@contoso.com`|`user@contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| + + To customize the safe list, call the method. + ]]> @@ -411,36 +411,36 @@ Encodes the specified string for use in form submissions whose MIME type is "application/x-www-form-urlencoded". The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - -The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. - -|Unicode code chart|Character(s)|Description| -|------------------------|--------------------|-----------------| -|A-Z|Uppercase alphabetic characters| -|a-z|Lowercase alphabetic characters| -|0-9|Numbers| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|_|Underscore| -|~|Tilde| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| -|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user@contoso.com`| -|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| - +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + +The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. + +|Unicode code chart|Character(s)|Description| +|------------------------|--------------------|-----------------| +|A-Z|Uppercase alphabetic characters| +|a-z|Lowercase alphabetic characters| +|0-9|Numbers| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|_|Underscore| +|~|Tilde| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| +|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user@contoso.com`| +|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| + ]]> @@ -470,36 +470,36 @@ The following table lists the default safe characters. All characters are from t Encodes the specified string for use in form submissions whose MIME type is "application/x-www-form-urlencoded" by using the specified code page. The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - - The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase alphabetic characters| -|a-z|Lowercase alphabetic characters| -|0-9|Numbers| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|_|Underscore| -|~|Tilde| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| -|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| - +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase alphabetic characters| +|a-z|Lowercase alphabetic characters| +|0-9|Numbers| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|_|Underscore| +|~|Tilde| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| +|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| + ]]> @@ -529,36 +529,36 @@ The following table lists the default safe characters. All characters are from t Encodes the specified string for form submissions whose MIME type is "application/x-www-form-urlencoded" by using the specified character encoding type. The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - - The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase alphabetic characters| -|a-z|Lowercase alphabetic characters| -|0-9|Numbers| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|_|Underscore| -|~|Tilde| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| -|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| - +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range. + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase alphabetic characters| +|a-z|Lowercase alphabetic characters| +|0-9|Numbers| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|_|Underscore| +|~|Tilde| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert%28%27XSS+Attack%21%27%29%3b`| +|``|`%3cscript%3ealert%28%27XSS+Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`Anti-Cross Site Scripting Namespace`|`Anti-Cross+Site+Scripting+Namespace`| + ]]> @@ -593,34 +593,34 @@ The following table lists the default safe characters. All characters are from t The combination of upper code charts to mark as safe. Marks characters from the specified Unicode code charts as safe. - [!NOTE] -> The method must be called in the `Application_Start` method in the Global.asax file. - +> The method must be called in the `Application_Start` method in the Global.asax file. + ]]> The method was called outside the method in the Global.asax file. @@ -658,34 +658,34 @@ MarkAsSafe( Encodes the specified string for use in a URL. The encoded string. - alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| - + alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| + ]]> @@ -715,34 +715,34 @@ MarkAsSafe( Encodes the specified string for use in a URL by using the specified code page. The encoded string. - alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| - + alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| + ]]> @@ -772,34 +772,34 @@ MarkAsSafe( Encodes the specified string for use in a URL by using the specified character encoding type. The encoded string. - alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| - + alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| + ]]> @@ -831,34 +831,34 @@ MarkAsSafe( Encodes the specified byte array for use in a URL, starting at the specified offset in the byte array and encoding the specified number of bytes. The encoded byte array. - alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| -|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| - + alert('XSS Attack!');`|`%3cscript%3ealert%28%27XSS%20Attack%21%27%29%3b%3c%2fscript%3e`| +|`alert('XSSあAttack!');`|`alert%28%27XSS%e3%81%82Attack%21%27%29%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| + ]]> @@ -886,45 +886,45 @@ MarkAsSafe( Encodes path strings for use in a URL. The URL that contains the encoded path. - /[page].htm?v={value1}#x=[amount]`|`http://www.contoso.com:8080/%3cen-us%3e/%5bpage%5d.htm?v={value1}#x=[amount]`| -|`alert('XSS Attack!');`|`alert(%27XSS%20Attack%21%27)%3b`| -|``|`%3cscript%3ealert(%27XSS%20Attack%21%27)%3b%3c/script%3e`| -|`alert('XSSあAttack!');`|`alert(%27XSS%e3%81%82Attack%21%27)%3b`| -|`user@contoso.com`|`user%40contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| - - This method encodes only the path of a URL. This method will not encode the scheme (for example, `http:`, `ftp:`, or `file:`), the authority (for example, `www.northwind.com` or `www.contoso.com:8080`), or the query or fragment (for example, `?v=s978dfs9#x=103`). If there is no scheme or authority in the string, the string is assumed to be a relative path, and the path is encoded. In the following URL, only the substring `/default.htm` is encoded: - - `http://www.contoso.com:8080/default.htm?v=s978dfs9#x=103` - + /[page].htm?v={value1}#x=[amount]`|`http://www.contoso.com:8080/%3cen-us%3e/%5bpage%5d.htm?v={value1}#x=[amount]`| +|`alert('XSS Attack!');`|`alert(%27XSS%20Attack%21%27)%3b`| +|``|`%3cscript%3ealert(%27XSS%20Attack%21%27)%3b%3c/script%3e`| +|`alert('XSSあAttack!');`|`alert(%27XSS%e3%81%82Attack%21%27)%3b`| +|`user@contoso.com`|`user%40contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`%22Anti-Cross%20Site%20Scripting%20Namespace%22`| + + This method encodes only the path of a URL. This method will not encode the scheme (for example, `http:`, `ftp:`, or `file:`), the authority (for example, `www.northwind.com` or `www.contoso.com:8080`), or the query or fragment (for example, `?v=s978dfs9#x=103`). If there is no scheme or authority in the string, the string is assumed to be a relative path, and the path is encoded. In the following URL, only the substring `/default.htm` is encoded: + + `http://www.contoso.com:8080/default.htm?v=s978dfs9#x=103` + ]]> @@ -952,66 +952,66 @@ The following table lists the default safe characters. All characters are from t Encodes the specified string for use in XML attributes. The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - - The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. - - -|Unicode code chart|Character(s)|Description| -|------------------------|--------------------|-----------------| -|A-Z|Uppercase Latin alphabetic characters| -|a-z|Lowercase Latin alphabetic characters| -|0-9|Numbers| -|!|Exclamation mark| -|#|Number sign, hash| -|$|Dollar sign| -|%|Percent sign| -|( )|Parentheses| -|*|Asterisk| -|+|Plus sign| -|,|Comma| -|-|Hyphen, minus| -|.|Period, dot, full stop| -|/|Slash| -|:|Colon| -|;|Semicolon| -|=|Equals sign| -|?|Question mark| -|@|Commercial at-sign| -|[ ]|Square brackets| -|\|Backslash| -|^|Caret| -|_|Underscore| -|\`|Grave accent| -|{ }|Braces, curly brackets| -|||Vertical line| -|~|Tilde| -|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| -|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| -|0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| -|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| -|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range unless noted in the Description column. + + +|Unicode code chart|Character(s)|Description| +|------------------------|--------------------|-----------------| +|A-Z|Uppercase Latin alphabetic characters| +|a-z|Lowercase Latin alphabetic characters| +|0-9|Numbers| +|!|Exclamation mark| +|#|Number sign, hash| +|$|Dollar sign| +|%|Percent sign| +|( )|Parentheses| +|*|Asterisk| +|+|Plus sign| +|,|Comma| +|-|Hyphen, minus| +|.|Period, dot, full stop| +|/|Slash| +|:|Colon| +|;|Semicolon| +|=|Equals sign| +|?|Question mark| +|@|Commercial at-sign| +|[ ]|Square brackets| +|\|Backslash| +|^|Caret| +|_|Underscore| +|\`|Grave accent| +|{ }|Braces, curly brackets| +|||Vertical line| +|~|Tilde| +|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| +|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range.| +|0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| +|0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| +|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| |0x02B0 - 0x02FF|Characters between 0x02B0 (688 decimal) and 0x02FF (767 decimal). (The Unicode [Spacing Modifier Letters](https://www.unicode.org/charts/PDF/U02B0.pdf) character range.)| -|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert('XSS Attack!');`| -|``|`<script>alert('XSS Attack!');</script>`| -|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| -|`user@contoso.com`|`user@contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| - - To customize the safe list, call the method. - +|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert('XSS Attack!');`| +|``|`<script>alert('XSS Attack!');</script>`| +|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| +|`user@contoso.com`|`user@contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| + + To customize the safe list, call the method. + ]]> @@ -1039,66 +1039,66 @@ The following table lists the default safe characters. All characters are from t Encodes the specified string for use in XML attributes. The encoded string. - [!NOTE] -> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. - - The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range except when noted in the Description column. - -|Character(s)|Description| -|--------------------|-----------------| -|A-Z|Uppercase Latin alphabetic characters| -|a-z|Lowercase Latin alphabetic characters| -|0-9|Numbers| -|(Space)|Space| -|!|Exclamation mark| -|#|Number sign, hash| -|$|Dollar sign| -|%|Percent sign| -|( )|Parentheses| -|*|Asterisk| -|+|Plus sign| -|,|Comma| -|-|Hyphen, minus| -|.|Period| -|/|Slash| -|:|Colon| -|;|Semicolon| -|=|Equals sign| -|?|Question mark| -|@|Commercial at| -|[ ]|Square brackets| -|\|Backslash| -|^|Caret| -|_|Underscore| -|\`|Grave accent| -|{ }|Braces, curly brackets| -|||Vertical line| -|~|Tilde| -|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| -|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| -|0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| +> Put double quotation marks (" ") or single quotation marks (' ') around the resulting string before you add it to a page. + + The following table lists the default safe characters. All characters are from the Unicode [C0 Controls and Basic Latin](https://www.unicode.org/charts/PDF/U0000.pdf) character range except when noted in the Description column. + +|Character(s)|Description| +|--------------------|-----------------| +|A-Z|Uppercase Latin alphabetic characters| +|a-z|Lowercase Latin alphabetic characters| +|0-9|Numbers| +|(Space)|Space| +|!|Exclamation mark| +|#|Number sign, hash| +|$|Dollar sign| +|%|Percent sign| +|( )|Parentheses| +|*|Asterisk| +|+|Plus sign| +|,|Comma| +|-|Hyphen, minus| +|.|Period| +|/|Slash| +|:|Colon| +|;|Semicolon| +|=|Equals sign| +|?|Question mark| +|@|Commercial at| +|[ ]|Square brackets| +|\|Backslash| +|^|Caret| +|_|Underscore| +|\`|Grave accent| +|{ }|Braces, curly brackets| +|||Vertical line| +|~|Tilde| +|0x00A1 - 0x00AC|Special characters between 0x00A1 (161 decimal) and 0x00AC (172 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| +|0x00AE - 0x00FF|Special characters between 0x00AE (174 decimal) and 0x00FF (255 decimal) from the Unicode [C1 Controls and Latin-1 Supplement](https://www.unicode.org/charts/PDF/U0080.pdf) character range. Characters in this range are encoded when `useNamedEntities` is `true`.| +|0x0100 - 0x017F|Characters between 0x0100 (256 decimal) and 0x017F (383 decimal). (The Unicode [Latin-Extended-A](https://www.unicode.org/charts/PDF/U0100.pdf) character range.)| |0x0180 - 0x024F|Characters between 0x0180 (384 decimal) and 0x024F (591 decimal). (The Unicode [Latin-Extended-B](https://www.unicode.org/charts/PDF/U0180.pdf) character range.)| -|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| +|0x0250 - 0x02AF|Characters between 0x0250 (592 decimal) and 0x02AF (687 decimal). (The Unicode [IPA Extensions](https://www.unicode.org/charts/PDF/U0250.pdf) character range.)| |0x02B0 - 0x02FF|Characters between 0x02B0 (688 decimal) and 0x02FF (767 decimal). (The Unicode [Spacing Modifier Letters](https://www.unicode.org/charts/PDF/U02B0.pdf) character range.)| -|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| - - The following table lists examples of inputs and the corresponding encoded outputs. - -||| -|-|-| -|`alert('XSS Attack!');`|`alert('XSS Attack!');`| -|``|`<script>alert('XSS Attack!');</script>`| -|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| -|`user@contoso.com`|`user@contoso.com`| -|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| - - To customize the safe list, call the method. - +|0x0300 - 0x036F|Characters between 0x0300 (768 decimal) and 0x036F (879 decimal). (The Unicode [Combining Diacritical Marks](https://www.unicode.org/charts/PDF/U0300.pdf) character range.)| + + The following table lists examples of inputs and the corresponding encoded outputs. + +| Input | Output | +|-------|--------| +|`alert('XSS Attack!');`|`alert('XSS Attack!');`| +|``|`<script>alert('XSS Attack!');</script>`| +|`alert('XSSあAttack!');`|`alert('XSSあAttack!');`| +|`user@contoso.com`|`user@contoso.com`| +|`"Anti-Cross Site Scripting Namespace"`|`"Anti-Cross Site Scripting Namespace"`| + + To customize the safe list, call the method. + ]]> diff --git a/xml/System.Web.Security/ActiveDirectoryMembershipUser.xml b/xml/System.Web.Security/ActiveDirectoryMembershipUser.xml index e544fefae08..ae121be9883 100644 --- a/xml/System.Web.Security/ActiveDirectoryMembershipUser.xml +++ b/xml/System.Web.Security/ActiveDirectoryMembershipUser.xml @@ -23,44 +23,44 @@ Exposes and updates membership user information stored in an Active Directory data store. - object is used to represent a single membership user in the Active Directory membership data store. It exposes information about the membership user such as the email address, and provides functionality for the membership user such as the ability to change or reset their password. - - An object is returned by the application's membership provider whenever the application is configured to use an Active Directory data store. In an application that can be configured to use different data stores, or in an application that uses multiple data stores, you can refer to the base class, . Because the object does not implement the and properties, you must be prepared to handle the that is thrown when these members are accessed on an object. - - The class implements internal optimizations used by the class to minimize the number of attribute updates that occur when calling the method. It also serializes the representation (available in the property) so that an object can be serialized and deserialized without throwing exceptions. - - A object is returned by the and methods or as part of a returned by the , , and methods. - - An object is required by the method when you want to update the information for an existing membership user. - - properties are mapped to Active Directory attributes. The following table lists the properties and their default attribute mappings. - -|Property|Default directory attribute|Can be mapped?| -|--------------|---------------------------------|--------------------| -||`securityIdentifier`|No| -||`userPrincipalName`|Yes, but must be either userPrincipalName or sAMAccountName| -||`comment`|No| -||`whenCreated`|No| -||`mail`|Yes, but must be a single-valued attribute of type Unicode String.| -||n/a|Not supported by .| -||n/a|Not supported by .| -||`pwdLastSet`|No| -||none, but must be mapped to an attribute if using question-and-answer security for password reset or retrieval.|Yes, but must be a single-valued attribute of type Unicode String.| -||`User-Account-Control` (AD)

`mDS-UserAccountDisabled` (ADAM)|No| -||computed from `lockoutTime` and the AD lockout duration (AD on Windows 2000)

`msDS-User-Account-Control-Computed` (AD on Windows Server 2003)

`msDS-User-Account-Control-Computed` (ADAM)|No| -||If locked out due to too many bad password attempts, the lockout time attribute is returned.

If locked out due to too many bad password answer attempts, the value stored in the attribute defined by `attributeMapFailedPasswordAnswerLockoutTime` is returned.

If locked out due to both a bad password and too many bad password attempts, the most recent date/time value is returned.

If the account is not locked out, return 1/1/1753 for SQL compatibility.|No| - - - -## Examples - The following code example demonstrates using properties on the object on a Web page that may return user information from multiple membership data stores. Because the object that underlies the object returned by the membership provider does not implement the and properties, the code first checks the type of the user object returned from the membership provider before displaying the contents of those properties. - + object is used to represent a single membership user in the Active Directory membership data store. It exposes information about the membership user such as the email address, and provides functionality for the membership user such as the ability to change or reset their password. + + An object is returned by the application's membership provider whenever the application is configured to use an Active Directory data store. In an application that can be configured to use different data stores, or in an application that uses multiple data stores, you can refer to the base class, . Because the object does not implement the and properties, you must be prepared to handle the that is thrown when these members are accessed on an object. + + The class implements internal optimizations used by the class to minimize the number of attribute updates that occur when calling the method. It also serializes the representation (available in the property) so that an object can be serialized and deserialized without throwing exceptions. + + A object is returned by the and methods or as part of a returned by the , , and methods. + + An object is required by the method when you want to update the information for an existing membership user. + + properties are mapped to Active Directory attributes. The following table lists the properties and their default attribute mappings. + +|Property|Default directory attribute|Can be mapped?| +|--------------|---------------------------------|--------------------| +||`securityIdentifier`|No| +||`userPrincipalName`|Yes, but must be either userPrincipalName or sAMAccountName| +||`comment`|No| +||`whenCreated`|No| +||`mail`|Yes, but must be a single-valued attribute of type Unicode String.| +||n/a|Not supported by .| +||n/a|Not supported by .| +||`pwdLastSet`|No| +||none, but must be mapped to an attribute if using question-and-answer security for password reset or retrieval.|Yes, but must be a single-valued attribute of type Unicode String.| +||`User-Account-Control` (AD)

`mDS-UserAccountDisabled` (ADAM)|No| +||computed from `lockoutTime` and the AD lockout duration (AD on Windows 2000)

`msDS-User-Account-Control-Computed` (AD on Windows Server 2003)

`msDS-User-Account-Control-Computed` (ADAM)|No| +||If locked out due to too many bad password attempts, the lockout time attribute is returned.

If locked out due to too many bad password answer attempts, the value stored in the attribute defined by `attributeMapFailedPasswordAnswerLockoutTime` is returned.

If locked out due to both a bad password and too many bad password attempts, the most recent date/time value is returned.

If the account is not locked out, return 1/1/1753 for SQL compatibility.|No| + + + +## Examples + The following code example demonstrates using properties on the object on a Web page that may return user information from multiple membership data stores. Because the object that underlies the object returned by the membership provider does not implement the and properties, the code first checks the type of the user object returned from the membership provider before displaying the contents of those properties. + [!code-aspx-csharp[System.Web.Security.ActiveDirectoryMembershipUser#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/CS/admuClassExamplecs.aspx#1)] - [!code-aspx-vb[System.Web.Security.ActiveDirectoryMembershipUser#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#1)] - + [!code-aspx-vb[System.Web.Security.ActiveDirectoryMembershipUser#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#1)] + ]]>
Introduction to Membership @@ -91,11 +91,11 @@ Initializes a new instance of an object for a class that inherits the class. - constructor is not intended to be used from your code. - + constructor is not intended to be used from your code. + ]]> @@ -144,22 +144,22 @@ The for the membership user. Creates a new instance of the class with the specified property values. - object does not add a new membership user object to the membership data store. To add a new membership user to the membership data store, use the method. Note that the method returns an object for the membership user added to the data store. - - objects are commonly constructed in application code for use with the method, although you can also pass an object returned from the , , , , or method to the method as well. - - objects are also commonly constructed by membership provider implementations for the , , , , , and methods. - + object does not add a new membership user object to the membership data store. To add a new membership user to the membership data store, use the method. Note that the method returns an object for the membership user added to the data store. + + objects are commonly constructed in application code for use with the method, although you can also pass an object returned from the , , , , or method to the method as well. + + objects are also commonly constructed by membership provider implementations for the , , , , , and methods. + ]]> - is not a object. - + is not a object. + -or- - + is and a provider is not set in the application's configuration file.
@@ -183,13 +183,13 @@ Gets or sets application-specific information for the membership user. Application-specific information for the Active Directory member stored in the directory attribute. - property can be used to store custom information for a membership user that is specific to an application. The amount of information that can be stored in the `Comment` property for an is defined by the . - - The property is mapped to the `Comment` default Active Directory attribute. This property cannot be remapped to another attribute. - + property can be used to store custom information for a membership user that is specific to an application. The amount of information that can be stored in the `Comment` property for an is defined by the . + + The property is mapped to the `Comment` default Active Directory attribute. This property cannot be remapped to another attribute. + ]]> @@ -214,11 +214,11 @@ Gets or sets the email address of the membership user. The email address of the membership user. - property is mapped to the `Mail` directory attribute. This property can be remapped in the Web.config file by setting the `attributeMapUserName` attribute in the [providers Element for profile (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164654(v=vs.100)) element for profiles. - + property is mapped to the `Mail` directory attribute. This property can be remapped in the Web.config file by setting the `attributeMapUserName` attribute in the [providers Element for profile (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164654(v=vs.100)) element for profiles. + ]]> @@ -244,20 +244,20 @@ if the user can be authenticated; otherwise, . - value for a membership user is checked during the call to by the . If the property returns `false`, the method returns `false` even if the supplied user name and password are correct. - - The property is mapped to one of the following Active Directory attributes. - -||| -|-|-| -|Active Directory|`User-Account-Control`| -|Active Directory Application Mode|`msDS-UserAccountDisabled`| - - This property cannot be remapped to another attribute. - + value for a membership user is checked during the call to by the . If the property returns `false`, the method returns `false` even if the supplied user name and password are correct. + + The property is mapped to one of the following Active Directory attributes. + +| Service | Attribute | +|-----------------------------------|----------------------------| +| Active Directory | `User-Account-Control` | +| Active Directory Application Mode | `msDS-UserAccountDisabled` | + + This property cannot be remapped to another attribute. + ]]> @@ -282,19 +282,19 @@ Throws a exception in all cases. Always throws a exception. - property is not supported by the class. Attempting to get or set the value will always throw a . - - - -## Examples - The following code example demonstrates how to determine whether the underlying type of a membership user is , and to avoid throwing a for accessing the property. For the full code required to run the example, see the Example section of the class overview topic. - + property is not supported by the class. Attempting to get or set the value will always throw a . + + + +## Examples + The following code example demonstrates how to determine whether the underlying type of a membership user is , and to avoid throwing a for accessing the property. For the full code required to run the example, see the Example section of the class overview topic. + [!code-csharp[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/CS/admuClassExamplecs.aspx#2)] - [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#2)] - + [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#2)] + ]]> any attempt to get or set the property. @@ -320,19 +320,19 @@ Throws a exception in all cases. Always throws a exception. - property is not supported by the class. Attempting to get or set the value will always throw a . - - - -## Examples - The following code example demonstrates how to determine whether the underlying type of a membership user is , and to avoid throwing a for accessing the property. For the full code required to run the example, see the Example section of the class overview topic. - + property is not supported by the class. Attempting to get or set the value will always throw a . + + + +## Examples + The following code example demonstrates how to determine whether the underlying type of a membership user is , and to avoid throwing a for accessing the property. For the full code required to run the example, see the Example section of the class overview topic. + [!code-csharp[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/CS/admuClassExamplecs.aspx#2)] - [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#2)] - + [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#2)] + ]]> any attempt to get or set the property. @@ -358,19 +358,19 @@ Gets the user identifier from the Active Directory data store for the membership user. The user identifier from the Active Directory data store for the membership user. - property exposes the identifier from the membership data source generically typed as an `object`. The class can be cast as a object. - - - -## Examples - The following code example displays the property in Security Descriptor Definition Language (SDDL) format by converting it to a object. For the full code required to run the example, see the Example section of the class overview topic. - + property exposes the identifier from the membership data source generically typed as an `object`. The class can be cast as a object. + + + +## Examples + The following code example displays the property in Security Descriptor Definition Language (SDDL) format by converting it to a object. For the full code required to run the example, see the Example section of the class overview topic. + [!code-csharp[System.Web.Security.ActiveDirectoryMembershipUser#3](~/snippets/csharp/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/CS/admuClassExamplecs.aspx#3)] - [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#3](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#3)] - + [!code-vb[System.Web.Security.ActiveDirectoryMembershipUser#3](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.Security.ActiveDirectoryMembershipUser/VB/admuClassExamplevb.aspx#3)] + ]]> diff --git a/xml/System.Web.UI.DataVisualization.Charting/DataPoint.xml b/xml/System.Web.UI.DataVisualization.Charting/DataPoint.xml index c5afd19a2f1..9c8fe352f64 100644 --- a/xml/System.Web.UI.DataVisualization.Charting/DataPoint.xml +++ b/xml/System.Web.UI.DataVisualization.Charting/DataPoint.xml @@ -30,17 +30,17 @@ Represents a data point that is stored in the class. - class stores properties associated with data as well as data point values. For example, a data point has a value, but it also has a color property, background image property, background gradient property, and so forth. For more information about data point properties, see the class overview topic. - - Each data point consists of an X-value and one or more Y-values. The X-value can be zero, or you can set this explicitly. - - Only one Y-value per point is required for all chart types except bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. - - Data can be added at either design time or run time; you can also use data-binding at run time. - + class stores properties associated with data as well as data point values. For example, a data point has a value, but it also has a color property, background image property, background gradient property, and so forth. For more information about data point properties, see the class overview topic. + + Each data point consists of an X-value and one or more Y-values. The X-value can be zero, or you can set this explicitly. + + Only one Y-value per point is required for all chart types except bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. + + Data can be added at either design time or run time; you can also use data-binding at run time. + ]]> @@ -69,13 +69,13 @@ Initializes a new instance of the class. - class. - - However, it is highly recommended that you instead add data points at run time, using the collection property. - + class. + + However, it is highly recommended that you instead add data points at run time, using the collection property. + ]]> @@ -99,13 +99,13 @@ The object that the data point belongs to. Initializes a new instance of the class, and sets the that the data point belongs to. - class. - - However, it is highly recommended that you instead add data points at run time, using the collection property. - + class. + + However, it is highly recommended that you instead add data points at run time, using the collection property. + ]]> @@ -131,13 +131,13 @@ The Y-value of the data point. Initializes a new instance of the class with the specified X and Y-value. - class. - - However, it is highly recommended that you instead add data points at run time, using the collection property. - + class. + + However, it is highly recommended that you instead add data points at run time, using the collection property. + ]]> @@ -163,13 +163,13 @@ An array of Y-values. Initializes a new instance of the class with the specified X-value and an array of Y-values. - class. - - However, it is highly recommended that you instead add data points at run time, using the collection property. - + class. + + However, it is highly recommended that you instead add data points at run time, using the collection property. + ]]> @@ -201,13 +201,13 @@ A of Y-values separated by commas. Initializes a new instance of the class with the specified X-value and Y-values. - class. - - However, it is highly recommended that you instead add data points at run time, using the collection property. - + class. + + However, it is highly recommended that you instead add data points at run time, using the collection property. + ]]> @@ -232,11 +232,11 @@ Returns an exact copy of the data point. A cloned object. - method to obtain an exact copy of the data point. - + method to obtain an exact copy of the data point. + ]]> @@ -304,15 +304,15 @@ if the point is marked as an empty point; otherwise, . The default value is . - class can be used to mark missing data as empty points. - - The property determines how empty points are displayed. - + class can be used to mark missing data as empty points. + + The property determines how empty points are displayed. + ]]> @@ -383,21 +383,25 @@ A list of Y-values of the data point. Sets the X-value and one or more Y-values of the data point. - method to set the value(s) of a data point at run-time. - - Note that if you set the X-value to a value other than zero (0), a scatter plot will be generated. For further details, see the Remarks section of the property. - - Refer to the following table for a complete listing of valid .NET Framework types that can be used for the object type parameter. - -|||| -|-|-|-| -|String|DateTime|Double| -|Decimal|Single|Int32| -|UInt32|Int64|UInt64| - + method to set the value(s) of a data point at run-time. + + Note that if you set the X-value to a value other than zero (0), a scatter plot will be generated. For further details, see the Remarks section of the property. + +The following .NET types can be used for the object type parameter: + +- String +- DateTime +- Double +- Decimal +- Single +- Int32 +- UInt32 +- Int64 +- UInt64 + ]]> @@ -431,26 +435,30 @@ The Y-value(s) of a object in the collection. Formatted as one or more values separated by commas. Sets the Y-value(s) of a single data point. - property is used to set the Y-value(s) of a data point at run time. - - Only one Y-value per point is required for all chart types except for bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. - - This property returns an array of `double` values when used to retrieve multiple Y-values. - + property is used to set the Y-value(s) of a data point at run time. + + Only one Y-value per point is required for all chart types except for bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. + + This property returns an array of `double` values when used to retrieve multiple Y-values. + > [!IMPORTANT] -> The property determines the maximum number of Y-values that all data points in a can have. If you specify more than the allowable number of Y-values, an exception will be raised. -> -> Refer to the following table for a complete listing of valid .NET Framework types that can be used for the object type parameter: - -|||| -|-|-|-| -|String|DateTime|Double| -|Decimal|Single|Int32| -|UInt32|Int64|UInt64| - +> The property determines the maximum number of Y-values that all data points in a can have. If you specify more than the allowable number of Y-values, an exception will be raised. + +The following .NET Framework types can be used for the object type parameter: + +- String +- DateTime +- Double +- Decimal +- Single +- Int32 +- UInt32 +- Int64 +- UInt64 + ]]> @@ -496,13 +504,13 @@ Gets or sets the X-value of a data point. A that represents the X-value of a data point. - . - + . + ]]> @@ -552,18 +560,18 @@ Gets or sets the Y-value(s) of a data point. An array of values that represent the Y-value(s) of a data point. - property is used to set the Y-values of data points. - - Only one Y-value per point is required for all chart types except bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. - - The property returns an array of `double` values when used to retrieve the Y-values. - + property is used to set the Y-values of data points. + + Only one Y-value per point is required for all chart types except bubble, candlestick and stock charts. These chart types require more than one Y-value because one data point consists of multiple values. For example, to plot one stock chart column, four values are required: high, low, open and close values. + + The property returns an array of `double` values when used to retrieve the Y-values. + > [!IMPORTANT] - > The property determines the maximum number of Y-values that all data points in a can have. If you specify more than the allowable number of Y-values, an exception will be raised. - + > The property determines the maximum number of Y-values that all data points in a can have. If you specify more than the allowable number of Y-values, an exception will be raised. + ]]> diff --git a/xml/System.Web.UI.DataVisualization.Charting/DataPointCollection.xml b/xml/System.Web.UI.DataVisualization.Charting/DataPointCollection.xml index 79027162901..0c145d19283 100644 --- a/xml/System.Web.UI.DataVisualization.Charting/DataPointCollection.xml +++ b/xml/System.Web.UI.DataVisualization.Charting/DataPointCollection.xml @@ -25,21 +25,21 @@ Represents a collection of objects. - class represents a collection of objects, which in turn represent the data points that are part of a object. - - This collection class is implemented as the property of a object. - - objects can be appended or inserted into the collection with their X-value and Y-value(s) already specified as parameters. Note that they are also added automatically when a series is bound to a data source using either the or method. - - Data points are plotted in the order that they occur in this collection only if the series that the collection belongs to has its property set to `true` (the default value is `false`), or if all X-values for all data points are zero. Otherwise data points are plotted using their X-values. - - Data points can be located, and manipulated, based on maximum, minimum or specified X or Y-values using the overloaded `FindMaxValue`, `FindMinValue` or `FindValue` methods, respectively. - - The [DataPointCollection.Count]() property indicates the total number of items in the collection and is commonly used to find the upper bound of the collection. - + class represents a collection of objects, which in turn represent the data points that are part of a object. + + This collection class is implemented as the property of a object. + + objects can be appended or inserted into the collection with their X-value and Y-value(s) already specified as parameters. Note that they are also added automatically when a series is bound to a data source using either the or method. + + Data points are plotted in the order that they occur in this collection only if the series that the collection belongs to has its property set to `true` (the default value is `false`), or if all X-values for all data points are zero. Otherwise data points are plotted using their X-values. + + Data points can be located, and manipulated, based on maximum, minimum or specified X or Y-values using the overloaded `FindMaxValue`, `FindMinValue` or `FindValue` methods, respectively. + + The [DataPointCollection.Count]() property indicates the total number of items in the collection and is commonly used to find the upper bound of the collection. + ]]> @@ -110,15 +110,15 @@ Adds a object to the end of the collection, with the specified X-value and Y-value. An that represents the zero-based index where the item was inserted into the data point collection. - object to the ; the object is always added to the end of the collection. - - Use the method overload if your data points require more than one Y-value. - - If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the method instead. - + object to the ; the object is always added to the end of the collection. + + Use the method overload if your data points require more than one Y-value. + + If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the method instead. + ]]> @@ -155,17 +155,17 @@ Adds a object to the end of the collection, with the specified X-value and Y-value(s). An value that represents the zero-based index where the item was inserted into the collection. - object to the ; the data point is always added to the end of the collection. - - You must provide at least one (1) Y-value, otherwise an exception will be thrown. This method also checks the property of the object that this data belongs to; if too many Y-values are specified, an exception will be thrown. - - In order for formatting to have an effect, a value must be a object. - - If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the method instead - + object to the ; the data point is always added to the end of the collection. + + You must provide at least one (1) Y-value, otherwise an exception will be thrown. This method also checks the property of the object that this data belongs to; if too many Y-values are specified, an exception will be thrown. + + In order for formatting to have an effect, a value must be a object. + + If your data points do not need an X-value - that is, if you are creating non-scatter plots - use the method instead + ]]> @@ -202,15 +202,15 @@ Adds a object to the end of the collection, with the specified Y-value. An that represents the zero-based index where the item was inserted into the data point collection. - object to the ; the data point is always added to the end of the collection. - - Use the method definition that allows for an array of Y-values if your data points require more than one Y-value. - - If your data points need an X-value - that is, if you are creating scatter plots - use one of the `AddXY` methods instead. - + object to the ; the data point is always added to the end of the collection. + + Use the method definition that allows for an array of Y-values if your data points require more than one Y-value. + + If your data points need an X-value - that is, if you are creating scatter plots - use one of the `AddXY` methods instead. + ]]> @@ -245,25 +245,29 @@ Adds a object to the end of the collection, with the specified Y-value(s). An that represents the location in zero-based index where the item was inserted into the collection. - object to the ; the data point is always added to the end of the collection. - - You must provide at least one (1) Y-value, otherwise an exception will be thrown. This method also checks the property of the object this data belongs to; if too many Y-values are specified, an exception will be thrown. - - The X-value will always be set to zero (0), resulting in non-scatter plots. If you want the data points to use an X-value, call one of the `AddXY` methods instead. - - In order for formatting to have an effect, a value must be a object. - - Refer to the following for a complete listing of valid .NET Framework types that can be used for the object type parameters: - -|||| -|-|-|-| -|String|DateTime|Double| -|Decimal|Single|Int32| -|UInt32|Int64|UInt64| - + object to the ; the data point is always added to the end of the collection. + + You must provide at least one (1) Y-value, otherwise an exception will be thrown. This method also checks the property of the object this data belongs to; if too many Y-values are specified, an exception will be thrown. + + The X-value will always be set to zero (0), resulting in non-scatter plots. If you want the data points to use an X-value, call one of the `AddXY` methods instead. + + In order for formatting to have an effect, a value must be a object. + +The following .NET types can be used for the object type parameters: + +- String +- DateTime +- Double +- Decimal +- Single +- Int32 +- UInt32 +- Int64 +- UInt64 + ]]> @@ -293,16 +297,16 @@ The data source. The name of the field for X-values. A comma separated names of the fields for Y-values. - Other data point properties with binding rules, in the format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. - + Other data point properties with binding rules, in the format: PointProperty=Field[{Format}] [,PointProperty=Field[{Format}]]. + For example: "Tooltip=Price{C1},Url=WebSiteName". Data binds the X-value, Y-value(s) and property values of the data points, such as Tooltip or LabelStyle, to the data source. - @@ -347,31 +351,31 @@ A comma-separated list of the Y-value(s) of the object added to the collection. Data binds the X-value and Y-values of the collection's data points to the first columns of the specified data source. - objects in a , and uses separate data sources for the X and Y-value(s). - - Note that the first available column in the data source will be used if data-binding to a table. To bind to a column other than the first column, use the method. - - You can bind to multiple Y-values by providing a comma-separated list of objects for the `yValues` parameter. - - If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown. - - If you do not want to display scatter-type plots, in which both X and Y-values are used, use one of the `DataBindY` methods instead. - - The following is a list of objects that you can use as the data source parameter: - -- DataView - -- Data readers (SQL, OleDB) - -- Arrays - -- Lists - -- All other objects that use the interface. - + objects in a , and uses separate data sources for the X and Y-value(s). + + Note that the first available column in the data source will be used if data-binding to a table. To bind to a column other than the first column, use the method. + + You can bind to multiple Y-values by providing a comma-separated list of objects for the `yValues` parameter. + + If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown. + + If you do not want to display scatter-type plots, in which both X and Y-values are used, use one of the `DataBindY` methods instead. + + The following is a list of objects that you can use as the data source parameter: + +- DataView + +- Data readers (SQL, OleDB) + +- Arrays + +- Lists + +- All other objects that use the interface. + ]]> @@ -404,29 +408,29 @@ A comma-separated list of column name(s) that will supply the Y-values for the data points. Note that a comma can be embedded as part of a column name, by using a double comma. Data binds the X-value and Y-values of the data points in the collection to the specified columns of the specified data sources. - interface. - + interface. + ]]> @@ -475,31 +479,31 @@ One or more comma-separated data sources. Data binds the Y-value(s) of the collection's data points to the first column of the specified data source(s). - method. - - You can bind several Y-values by specifying multiple data sources, using the `yValue` parameter. Note that the first available column in each data source will be used for each data point's successive Y-values. For example, the first column of the first data source will be bound to the first Y-value of data points, the first column of the second data source will be bound to the second Y-value of data points, and so forth. - - If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown. - - The following is a list of objects that you can use as the data source parameter: - - The following is a list of objects that you can use as the data source: - -- DataView - -- Data readers (SQL, OleDB) - -- Arrays - -- Lists - -- All other objects that use the interface. - + method. + + You can bind several Y-values by specifying multiple data sources, using the `yValue` parameter. Note that the first available column in each data source will be used for each data point's successive Y-values. For example, the first column of the first data source will be bound to the first Y-value of data points, the first column of the second data source will be bound to the second Y-value of data points, and so forth. + + If Y-values are not provided by the data source, or if the wrong number of values are provided, an exception will be thrown. + + The following is a list of objects that you can use as the data source parameter: + + The following is a list of objects that you can use as the data source: + +- DataView + +- Data readers (SQL, OleDB) + +- Arrays + +- Lists + +- All other objects that use the interface. + ]]> @@ -534,29 +538,29 @@ The data source field(s) to which to bind data point(s). Note that a comma can be embedded as part of a column name, by using a double comma. Data binds the Y-value(s) of the data points to the specified column(s) of the specified data source. - method. - - You can bind to several fields by setting the `yFields` parameter to multiple field names that are comma-separated. Note that the first field will be used for the data point's first Y-value, the second named field will be used for the data point's second Y-value, and so forth. - - If Y-values are not provided by the data source, or the wrong number of values are provided, an exception will be thrown. - - The following is a list of objects that you can use as the data source: - -- DataView - -- Data readers (SQL, OleDB) - -- Arrays - -- Lists - -- All other objects that use the interface. - + method. + + You can bind to several fields by setting the `yFields` parameter to multiple field names that are comma-separated. Note that the first field will be used for the data point's first Y-value, the second named field will be used for the data point's second Y-value, and so forth. + + If Y-values are not provided by the data source, or the wrong number of values are provided, an exception will be thrown. + + The following is a list of objects that you can use as the data source: + +- DataView + +- Data readers (SQL, OleDB) + +- Arrays + +- Lists + +- All other objects that use the interface. + ]]> diff --git a/xml/System.Web.UI.WebControls/CheckBoxList.xml b/xml/System.Web.UI.WebControls/CheckBoxList.xml index 0f9686a661c..d708443ddc5 100644 --- a/xml/System.Web.UI.WebControls/CheckBoxList.xml +++ b/xml/System.Web.UI.WebControls/CheckBoxList.xml @@ -28,132 +28,132 @@ Creates a multi selection check box group that can be dynamically created by binding the control to a data source. - -## Introduction - The control provides a multi selection check box group that can be dynamically generated with data binding. It contains an collection with members corresponding to individual items in the list. To determine which items are checked, iterate through the collection and test the property of each item in the list. - + +## Introduction + The control provides a multi selection check box group that can be dynamically generated with data binding. It contains an collection with members corresponding to individual items in the list. To determine which items are checked, iterate through the collection and test the property of each item in the list. + > [!NOTE] -> You can also use multiple controls. The control is easier for creating a set of check boxes using data binding, while the individual control gives you greater control over layout. - - -## Specifying List Layout - You can specify the way the list is displayed by using the and properties. For information about layout options, see the enumeration. - - By default, is set to `RepeatDirection.Vertical`. Setting this property to `RepeatDirection.Horizontal` renders the list horizontally. Some settings do not allow horizontal layout. For more information, see the enumeration. - - -## Specifying List Items - To specify items that you want to appear in the control, place a `ListItem` element for each entry between the opening and closing tags of the control. - - The control also supports data binding. To bind the control to a data source, first create a data source, such as one of the objects, that contains the items to display in the control. Next, use the method to bind the data source to the control. Use the and properties to specify which field in the data source to bind to the `Text` and `Value` properties of each list item in the control, respectively. The control will now display the information from the data source. - - To determine the selected items in the control, iterate through the collection and test the property of each item in the collection. - +> You can also use multiple controls. The control is easier for creating a set of check boxes using data binding, while the individual control gives you greater control over layout. + + +## Specifying List Layout + You can specify the way the list is displayed by using the and properties. For information about layout options, see the enumeration. + + By default, is set to `RepeatDirection.Vertical`. Setting this property to `RepeatDirection.Horizontal` renders the list horizontally. Some settings do not allow horizontal layout. For more information, see the enumeration. + + +## Specifying List Items + To specify items that you want to appear in the control, place a `ListItem` element for each entry between the opening and closing tags of the control. + + The control also supports data binding. To bind the control to a data source, first create a data source, such as one of the objects, that contains the items to display in the control. Next, use the method to bind the data source to the control. Use the and properties to specify which field in the data source to bind to the `Text` and `Value` properties of each list item in the control, respectively. The control will now display the information from the data source. + + To determine the selected items in the control, iterate through the collection and test the property of each item in the collection. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - -## Accessibility - For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)) and [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). - - -## Declarative Syntax - -``` - -             - -``` - - - -## Examples - A Visual Studio Web site project with source code is available to accompany this topic: [Download](https://go.microsoft.com/fwlink/?LinkId=191890). - - The following code example demonstrates how to create a control on a Web page. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + +## Accessibility + For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)) and [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). + + +## Declarative Syntax + +``` + +             + +``` + + + +## Examples + A Visual Studio Web site project with source code is available to accompany this topic: [Download](https://go.microsoft.com/fwlink/?LinkId=191890). + + The following code example demonstrates how to create a control on a Web page. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxList/CS/checkboxlistcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxList/VB/checkboxlistvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxList/VB/checkboxlistvb.aspx" id="Snippet1"::: + ]]> @@ -181,22 +181,22 @@ Initializes a new instance of the class. - class. - - - -## Examples - The following code example demonstrates how to create and initialize a new instance of the control. - + class. + + + +## Examples + The following code example demonstrates how to create and initialize a new instance of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListCtor/CS/checkboxlistctorcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCtor/VB/checkboxlistctorvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCtor/VB/checkboxlistctorvb.aspx" id="Snippet1"::: + ]]> CheckBox and CheckBoxList Web Server Controls @@ -233,27 +233,27 @@ Gets or sets the distance (in pixels) between the border and contents of the cell. The distance (in pixels) between the border and contents of the cell. The default is -1, which indicates this property is not set. - control. - - The padding amount specified is added to all four sides of a cell with the height of the tallest cell and width of the widest cell in the control. The resulting cell size is applied uniformly to all cells in the control. - - - -## Examples - The following code example demonstrates how to use the property to specify that the cell padding for the control is 5 pixels. - + control. + + The padding amount specified is added to all four sides of a cell with the height of the tallest cell and width of the widest cell in the control. The resulting cell size is applied uniformly to all cells in the control. + + + +## Examples + The following code example demonstrates how to use the property to specify that the cell padding for the control is 5 pixels. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListCellPadding/CS/checkboxlistcellpaddingcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCellPadding/VB/checkboxlistcellpaddingvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCellPadding/VB/checkboxlistcellpaddingvb.aspx" id="Snippet1"::: + ]]> @@ -291,25 +291,25 @@ Gets or sets the distance (in pixels) between cells. The distance (in pixels) between cells. The default is , which indicates that this property is not set. - control. This property is applied both vertically and horizontally. - - - -## Examples - The following code example demonstrates how to use the property to specify that the cell spacing for the control is 5 pixels. - + control. This property is applied both vertically and horizontally. + + + +## Examples + The following code example demonstrates how to use the property to specify that the cell spacing for the control is 5 pixels. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListCellPadding/CS/checkboxlistcellpaddingcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCellPadding/VB/checkboxlistcellpaddingvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListCellPadding/VB/checkboxlistcellpaddingvb.aspx" id="Snippet1"::: + ]]> @@ -338,21 +338,21 @@ Creates a style object that is used internally by the control to implement all style related properties. A that contains the style properties of the control. - method is used primarily by control developers in custom controls that derive from the class. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that it always returns a new instance of the class for the control. - + method is used primarily by control developers in custom controls that derive from the class. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that it always returns a new instance of the class for the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/CS/custom_checkboxlist_createcontrolstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/VB/custom_checkboxlist_createcontrolstylevb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/VB/custom_checkboxlist_createcontrolstylevb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/CS/custom_checkboxlist_createcontrolstyle.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/VB/custom_checkboxlist_createcontrolstyle.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListCreateControlStyle/VB/custom_checkboxlist_createcontrolstyle.vb" id="Snippet2"::: + ]]> CheckBox and CheckBoxList Web Server Controls @@ -385,13 +385,13 @@ Searches the current naming container for a server control with the specified ID and path offset. The method always returns the object. The current . - method is used primarily by control developers in custom controls that derive from the class. - - The method overrides the method of the base class. You should not override this version of the method. - + method is used primarily by control developers in custom controls that derive from the class. + + The method overrides the method of the base class. You should not override this version of the method. + ]]> CheckBox and CheckBoxList Web Server Controls @@ -424,13 +424,13 @@ , indicating that style attributes are not set on individual list items in a control. - method is used primarily by control developers in custom controls that derive from the class. - - The style attribute for the control applies to all list items that are contained by the control. Use the property of the to examine or set the style attribute for the control and its list items. - + method is used primarily by control developers in custom controls that derive from the class. + + The style attribute for the control applies to all list items that are contained by the control. Use the property of the to examine or set the style attribute for the control and its list items. + ]]> CheckBox and CheckBoxList Web Server Controls @@ -457,11 +457,11 @@ , indicating that a does not contain a footer section. - property is used primarily by control developers in custom controls that derive from the class. Footers are not supported when the property is set to or . - + property is used primarily by control developers in custom controls that derive from the class. Footers are not supported when the property is set to or . + ]]> CheckBox and CheckBoxList Web Server Controls @@ -488,11 +488,11 @@ , indicating that a does not contain a heading section. - property is used primarily by control developers in custom controls that derive from the class. Headers are not supported when the property is set to or . - + property is used primarily by control developers in custom controls that derive from the class. Headers are not supported when the property is set to or . + ]]> CheckBox and CheckBoxList Web Server Controls @@ -519,11 +519,11 @@ , indicating that a does not contain separators. - method is used primarily by control developers in custom controls that derive from the class. Separators are not supported when the property is set to or . - + method is used primarily by control developers in custom controls that derive from the class. Separators are not supported when the property is set to or . + ]]> CheckBox and CheckBoxList Web Server Controls @@ -556,15 +556,15 @@ if the state of the is different from the last posting; otherwise, . - method is used primarily by control developers in custom controls that derive from the class. - - The method indicates whether the state of the control has changed. In other words, it determines whether each list item in the control has the same value as the last posted value. A user selecting or clearing an item in the control changes the property value for the corresponding object in the collection of the control. If the same list items are selected in the control, or if the is disabled, returns `false`. - - When the method returns `true` for a control, the page framework invokes the method for the control. - + method is used primarily by control developers in custom controls that derive from the class. + + The method indicates whether the state of the control has changed. In other words, it determines whether each list item in the control has the same value as the last posted value. A user selecting or clearing an item in the control changes the property value for the corresponding object in the collection of the control. If the same list items are selected in the control, or if the is disabled, returns `false`. + + When the method returns `true` for a control, the page framework invokes the method for the control. + ]]> @@ -624,23 +624,23 @@ An that contains the event data. Configures the control prior to rendering on the client. - method is used primarily by control developers in custom controls that derive from the class. The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - The method performs any necessary prerendering steps prior to saving view state and rendering content for the . The individual list items contained in the control are initialized for rendering using the current , , and values. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that it always returns a new instance of the class for the . - + method is used primarily by control developers in custom controls that derive from the class. The method allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + The method performs any necessary prerendering steps prior to saving view state and rendering content for the . The individual list items contained in the control are initialized for rendering using the current , , and values. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that it always returns a new instance of the class for the . + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/CS/custom_checkboxlist_onprerendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/VB/custom_checkboxlist_onprerendervb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/VB/custom_checkboxlist_onprerendervb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/CS/custom_checkboxlist_onprerender.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/VB/custom_checkboxlist_onprerender.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListOnPreRender/VB/custom_checkboxlist_onprerender.vb" id="Snippet2"::: + ]]> @@ -669,15 +669,15 @@ Notifies the ASP.NET application that the state of the control has changed. - method is used primarily by control developers in custom controls that derive from the class. - - The page framework calls the method on a control when the method indicates that the state of the list items have changed in the control. The method calls the method to raise the event. Control developers can override the method to perform custom processing when the user selects or clears list items in the control. - - The method can optionally perform validation before raising the event for the control. To validate a group of controls on the page when a list item within the is selected, set the and properties to `true`, and specify the group of controls to validate in the property. - + method is used primarily by control developers in custom controls that derive from the class. + + The page framework calls the method on a control when the method indicates that the state of the list items have changed in the control. The method calls the method to raise the event. Control developers can override the method to perform custom processing when the user selects or clears list items in the control. + + The method can optionally perform validation before raising the event for the control. To validate a group of controls on the page when a list item within the is selected, set the and properties to `true`, and specify the group of controls to validate in the property. + ]]> @@ -713,23 +713,23 @@ A that contains the output stream for rendering on the client. Displays the on the client. - method is used primarily by control developers in custom controls that derive from the class. - - The implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual check box list items. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that the always displays an image. - + method is used primarily by control developers in custom controls that derive from the class. + + The implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual check box list items. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that the always displays an image. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListRender/CS/custom_checkboxlist_rendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListRender/VB/custom_checkboxlist_rendervb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListRender/VB/custom_checkboxlist_rendervb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListRender/CS/custom_checkboxlist_render.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListRender/VB/custom_checkboxlist_render.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListRender/VB/custom_checkboxlist_render.vb" id="Snippet2"::: + ]]> CheckBox and CheckBoxList Web Server Controls @@ -764,15 +764,15 @@ An object that represents the output stream to render HTML content on the client. Renders a list item in the control. - class. - - The implementation for a control calls the method, which in turn uses the method to render individual checkbox list items. - - The method for a control ignores the `itemType` and `repeatInfo` parameters. The `repeatIndex` value is used to select the checkbox list item in the collection, and the selected list item is rendered to the output stream. - + class. + + The implementation for a control calls the method, which in turn uses the method to render individual checkbox list items. + + The method for a control ignores the `itemType` and `repeatInfo` parameters. The `repeatIndex` value is used to select the checkbox list item in the collection, and the selected list item is rendered to the output stream. + ]]> CheckBox and CheckBoxList Web Server Controls @@ -841,25 +841,25 @@ Gets or sets the number of columns to display in the control. The number of columns to display in the control. The default is , which indicates this property is not set. - property is set to , you can use this property to specify the number of columns that display in the control. If this property is not set, the control displays all list items in a single column. - - - -## Examples - The following code example demonstrates how to use the property to specify that two columns are displayed in the control. - + property is set to , you can use this property to specify the number of columns that display in the control. If this property is not set, the control displays all list items in a single column. + + + +## Examples + The following code example demonstrates how to use the property to specify that two columns are displayed in the control. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListRepeatColumns/CS/checkboxlistrepeatcolumnscs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatColumns/VB/checkboxlistrepeatcolumnsvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatColumns/VB/checkboxlistrepeatcolumnsvb.aspx" id="Snippet1"::: + ]]> The number of columns is set to a negative value. @@ -899,44 +899,42 @@ Gets or sets a value that indicates whether the control displays vertically or horizontally. One of the values. The default is . - control. - + control. + > [!NOTE] -> The number of columns that are displayed is always determined by the property. - - If this property is set to `RepeatDirection.Vertical` and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if the property is set to `3`, the items in the control are displayed in three columns, as in the following table. - -|||| -|-|-|-| -|1|4|7| -|2|5|8| -|3|6|9| - - If this property is set to `RepeatDirection.Horizontal` and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if the property is set to `3`, the items of the control are displayed in rows of three items each, as in the following table. - -|||| -|-|-|-| -|1|2|3| -|4|5|6| -|7|8|9| - - - -## Examples - The following code example demonstrates how to set the property to specify that the display direction is vertical. - +> The number of columns that are displayed is always determined by the property. + + If this property is set to `RepeatDirection.Vertical` and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if the property is set to `3`, the items in the control are displayed in three columns, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 4 | 7 | +| 2 | 5 | 8 | +| 3 | 6 | 9 | + + If this property is set to `RepeatDirection.Horizontal` and if the property is set to , the first row is filled from left to right, then the next row, and so on until all items are rendered. For example, if the property is set to `3`, the items of the control are displayed in rows of three items each, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + +## Examples + The following code example demonstrates how to set the property to specify that the display direction is vertical. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListRepeatDirection/CS/checkboxlistrepeatdirectioncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatDirection/VB/checkboxlistrepeatdirectionvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatDirection/VB/checkboxlistrepeatdirectionvb.aspx" id="Snippet1"::: + ]]> The specified display direction of the list is not one of the values. @@ -965,13 +963,13 @@ Gets the number of list items in the control. The number of items in the . - property is used primarily by control developers in custom controls that derive from the class. - - If there are no items set in the , the is zero. If there are items set in the , the is the same as the property on the collection. - + property is used primarily by control developers in custom controls that derive from the class. + + If there are no items set in the , the is zero. If there are items set in the , the is the same as the property on the collection. + ]]> CheckBox and CheckBoxList Web Server Controls @@ -1008,27 +1006,27 @@ Gets or sets a value that specifies whether the list will be rendered by using a element, a element, an element, or a element. A value that specifies whether the list will be rendered by using a element, a element, an element, or a element. The default is . - enumeration. - + enumeration. + > [!NOTE] -> Two options are new as of ASP.NET 4: and . - - Some settings do not allow horizontal layout. For more information, see the enumeration. - - - -## Examples - The following code example demonstrates how to use the property to change the HTML that the control renders. - +> Two options are new as of ASP.NET 4: and . + + Some settings do not allow horizontal layout. For more information, see the enumeration. + + + +## Examples + The following code example demonstrates how to use the property to change the HTML that the control renders. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListRepeatLayout/CS/checkboxlistrepeatlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatLayout/VB/checkboxlistrepeatlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListRepeatLayout/VB/checkboxlistrepeatlayoutvb.aspx" id="Snippet1"::: + ]]> The specified layout is not one of the values. @@ -1075,13 +1073,13 @@ if the server control's state changes as a result of the postback; otherwise, . - method to process posted data for a object. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to process posted data for a object. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1121,13 +1119,13 @@ Raised when posted data for a control has changed. - method to raise an event when the posted data for a object changes. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to raise an event when the posted data for a object changes. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1173,23 +1171,23 @@ For a description of this member, see . A object that represents the style of the specified item type at the specified index in the list control. - method to retrieve the style of an item in a object. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - -## Examples - The following code example demonstrates how to use the interface members on a custom object. - + method to retrieve the style of an item in a object. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + + + +## Examples + The following code example demonstrates how to use the interface members on a custom object. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/CS/custom_checkboxlist_irepeatinfousercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouservb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouservb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/CS/custom_checkboxlist_irepeatinfouser.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouser.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouser.vb" id="Snippet2"::: + ]]> @@ -1229,13 +1227,13 @@ if the list control contains a footer section; otherwise, . - property to determine if a object contains a footer section. - - The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + property to determine if a object contains a footer section. + + The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1275,13 +1273,13 @@ if the list control contains a heading section; otherwise, . - property to determine a object contains a heading section. - - The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + property to determine a object contains a heading section. + + The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1321,13 +1319,13 @@ if the list control contains a separator; otherwise, . - property to determine whether a object contains a separator. - - The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + property to determine whether a object contains a separator. + + The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1376,23 +1374,23 @@ An object that represents the output stream to render HTML content on the client. For a description of this member, see . - method to render items in a object. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - - - -## Examples - The following code example demonstrates how to use the interface members on a custom object. - + method to render items in a object. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + + + +## Examples + The following code example demonstrates how to use the interface members on a custom object. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/CS/custom_checkboxlist_irepeatinfousercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouservb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouservb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/CS/custom_checkboxlist_irepeatinfouser.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouser.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCheckBoxListIRepeatInfoUser/VB/custom_checkboxlist_irepeatinfouser.vb" id="Snippet2"::: + ]]> @@ -1431,13 +1429,13 @@ Gets the number of items in the list control. The number of items in the list. - property to determine the number of items in a object. - - The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + property to determine the number of items in a object. + + The member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1478,25 +1476,25 @@ Gets or sets the text alignment for the check boxes within the group. One of the values. The default value is . - property to specify that the text associated with the check boxes appears on the right side of the control. - + property to specify that the text associated with the check boxes appears on the right side of the control. + > [!NOTE] -> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code samples use the single-file code model and may not work correctly if copied directly into a code-behind file. Each code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic CheckBoxList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CheckBoxListTextAlign/CS/checkboxlisttextaligncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListTextAlign/VB/checkboxlisttextalignvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CheckBoxListTextAlign/VB/checkboxlisttextalignvb.aspx" id="Snippet1"::: + ]]> The specified label text alignment is not one of the values. diff --git a/xml/System.Web.UI.WebControls/DataList.xml b/xml/System.Web.UI.WebControls/DataList.xml index 3ffde14f6c0..168ca566831 100644 --- a/xml/System.Web.UI.WebControls/DataList.xml +++ b/xml/System.Web.UI.WebControls/DataList.xml @@ -55,188 +55,188 @@ A data bound list control that displays items using templates. - -## Introduction - Use the control to display a template-defined data bound list. The control supports selecting and editing. - - -## Templates - The contents of the control can be manipulated by using templates. The following table lists the supported templates. - -|Template Name|Description| -|-------------------|-----------------| -||If defined, provides the content and layout for alternating items in the . If not defined, `ItemTemplate` is used.| -||If defined, provides the content and layout for the item currently being edited in the . If not defined, `ItemTemplate` is used.| -||If defined, provides the content and layout for the footer section of the . If not defined, a footer section will not be displayed.| -||If defined, provides the content and layout for the header section of the . If not defined, a header section will not be displayed.| -||Required template that provides the content and layout for items in the .| -||If defined, provides the content and layout for the currently selected item in the . If not defined, is used.| -||If defined, provides the content and layout for the separator between items in the . If not defined, a separator will not be displayed.| - - At the very minimum, the needs to be defined to display the items in the control. Additional templates can be used to provide a custom look to the control. - - -## Customizing the Appearance of the DataList Control - The appearance of the control may be customized by setting the style properties for the different parts of the control. The following table lists the different style properties. - -|Style Property|Description| -|--------------------|-----------------| -||Specifies the style for alternating items in the control.| -||Specifies the style for the item being edited in the control.| -||Specifies the style for the footer in the control.| -||Specifies the style for the header in the control.| -||Specifies the style for the items in the control.| -||Specifies the style for the selected item in the control.| -||Specifies the style for the separator between the items in the control.| - - You can also show or hide different parts of the control. The following table lists the properties that control which parts are shown or hidden. - -|Property|Description| -|--------------|-----------------| -||Shows or hides the footer section of the control.| -||Shows or hides the header section of the control.| - - -## Display Direction and Layout - The display direction of a control can be vertical or horizontal. Set the property to specify the display direction. - - The layout of the control is controlled with the property. Setting this property to `RepeatLayout.Table` will display the in a table format, while `RepeatLayout.Flow` displays the without a table structure. - - -## Security - The `DataList` control can contain controls that enable users to enter information. - + +## Introduction + Use the control to display a template-defined data bound list. The control supports selecting and editing. + + +## Templates + The contents of the control can be manipulated by using templates. The following table lists the supported templates. + +|Template Name|Description| +|-------------------|-----------------| +||If defined, provides the content and layout for alternating items in the . If not defined, `ItemTemplate` is used.| +||If defined, provides the content and layout for the item currently being edited in the . If not defined, `ItemTemplate` is used.| +||If defined, provides the content and layout for the footer section of the . If not defined, a footer section will not be displayed.| +||If defined, provides the content and layout for the header section of the . If not defined, a header section will not be displayed.| +||Required template that provides the content and layout for items in the .| +||If defined, provides the content and layout for the currently selected item in the . If not defined, is used.| +||If defined, provides the content and layout for the separator between items in the . If not defined, a separator will not be displayed.| + + At the very minimum, the needs to be defined to display the items in the control. Additional templates can be used to provide a custom look to the control. + + +## Customizing the Appearance of the DataList Control + The appearance of the control may be customized by setting the style properties for the different parts of the control. The following table lists the different style properties. + +|Style Property|Description| +|--------------------|-----------------| +||Specifies the style for alternating items in the control.| +||Specifies the style for the item being edited in the control.| +||Specifies the style for the footer in the control.| +||Specifies the style for the header in the control.| +||Specifies the style for the items in the control.| +||Specifies the style for the selected item in the control.| +||Specifies the style for the separator between the items in the control.| + + You can also show or hide different parts of the control. The following table lists the properties that control which parts are shown or hidden. + +|Property|Description| +|--------------|-----------------| +||Shows or hides the footer section of the control.| +||Shows or hides the header section of the control.| + + +## Display Direction and Layout + The display direction of a control can be vertical or horizontal. Set the property to specify the display direction. + + The layout of the control is controlled with the property. Setting this property to `RepeatLayout.Table` will display the in a table format, while `RepeatLayout.Flow` displays the without a table structure. + + +## Security + The `DataList` control can contain controls that enable users to enter information. + > [!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 about security, see [Securing Standard Controls](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - -## Declarative Syntax - -``` - -         -         - -         -         -         - -         -         -         - -         -         -         - -         -         -         - -         -         -         - -         -         -         - -         - -``` - - - -## Examples - The following code example demonstrates how to use a control to display a list of items from a data source. - +> 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 about security, see [Securing Standard Controls](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + +## Declarative Syntax + +``` + +         +         + +         +         +         + +         +         +         + +         +         +         + +         +         +         + +         +         +         + +         +         +         + +         + +``` + + + +## Examples + The following code example demonstrates how to use a control to display a list of items from a data source. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataList/CS/datalistcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataList/VB/datalistvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataList/VB/datalistvb.aspx" id="Snippet1"::: + ]]> @@ -265,19 +265,19 @@ Initializes a new instance of the class. - class. - - - -## Examples - The following code example demonstrates how to create and initialize a new instance of the class. - + class. + + + +## Examples + The following code example demonstrates how to create and initialize a new instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic DataList.DataList Example/CS/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.DataList Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.DataList Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -321,34 +321,34 @@ Gets the style properties for alternating items in the control. A object that represents the style properties for alternating items in the control. The default value is an empty object. - property to provide a custom style for the alternating items in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. - -|Precedence|Style property| -|----------------|--------------------| -|1|| -|2|| -|3|| -|4|| -|5|| - - To specify a custom style for the alternating items, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - - - -## Examples - The following code example demonstrates how to use the property to specify a different background color for alternating items in the control. - + property to provide a custom style for the alternating items in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. + +|Precedence|Style property| +|----------------|--------------------| +|1|| +|2|| +|3|| +|4|| +|5|| + + To specify a custom style for the alternating items, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + + + +## Examples + The following code example demonstrates how to use the property to specify a different background color for alternating items in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemStyle/CS/datalistitemstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemStyle/VB/datalistitemstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemStyle/VB/datalistitemstylevb.aspx" id="Snippet1"::: + ]]> @@ -403,27 +403,27 @@ Gets or sets the template for alternating items in the . A object that contains the template for alternating items in the control. The default value is . - property to control the contents of alternating items in the control. The appearance of alternating items is controlled by the property. - - To specify a template for the alternating items, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - + property to control the contents of alternating items in the control. The appearance of alternating items is controlled by the property. + + To specify a template for the alternating items, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of alternating items in the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of alternating items in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListAlternatingItemTemplate/CS/datalistaltitemtemplatecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListAlternatingItemTemplate/VB/datalistaltitemtemplatevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListAlternatingItemTemplate/VB/datalistaltitemtemplatevb.aspx" id="Snippet1"::: + ]]> @@ -455,35 +455,35 @@ Occurs when the button is clicked for an item in the control. - event is raised when the `Cancel` button is clicked for an item in the control. - - A typical handler for the event sets the property to `-1` (to deselect the item) and then rebinds the data to the control. - + event is raised when the `Cancel` button is clicked for an item in the control. + + A typical handler for the event sets the property to `-1` (to deselect the item) and then rebinds the data to the control. + > [!CAUTION] -> Text is not HTML encoded before it is displayed in the control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - +> Text is not HTML encoded before it is displayed in the control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It cancels any edits made to an item in the control when the `Cancel` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It cancels any edits made to an item in the control when the `Cancel` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -517,11 +517,11 @@ Represents the command name. This field is read-only. - field to represent the `Cancel` command name. - + field to represent the `Cancel` command name. + ]]> @@ -555,15 +555,15 @@ to use the control's data source; to indicate that the control is being recreated from view state and should not be data-bound. Creates the control hierarchy that is used to render the data list control, with or without the specified data source. - method is used primarily by control developers when deriving a custom implementation from the control. - - The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. - - Override the method to customize how controls are created or added to the control. Override the method to customize templates for a control. - + method is used primarily by control developers when deriving a custom implementation from the control. + + The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. + + Override the method to customize how controls are created or added to the control. Override the method to customize templates for a control. + ]]> @@ -590,21 +590,21 @@ Creates the default style object that is used internally by the control to implement all style related properties. A that contains the default style properties for the control. - method is used primarily by control developers in deriving a custom implementation from the control. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that it always displays horizontal grid lines with no cell spacing in the control. - + method is used primarily by control developers in deriving a custom implementation from the control. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that it always displays horizontal grid lines with no cell spacing in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDataListCreateControlStyle/CS/custom_datalist_createcontrolstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListCreateControlStyle/VB/custom_datalist_createcontrolstylevb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListCreateControlStyle/VB/custom_datalist_createcontrolstylevb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDataListCreateControlStyle/CS/custom_datalist_createcontrolstyle.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListCreateControlStyle/VB/custom_datalist_createcontrolstyle.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListCreateControlStyle/VB/custom_datalist_createcontrolstyle.vb" id="Snippet2"::: + ]]> @@ -636,13 +636,13 @@ Creates a object. A new created with the specified list-item type. - method is used primarily by control developers in creating a custom implementation of the control. The method is functionally equivalent to calling the constructor for a . The and properties are initialized for the new using the specified values, but the item is not inserted into the . - - The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. - + method is used primarily by control developers in creating a custom implementation of the control. The method is functionally equivalent to calling the constructor for a . The and properties are initialized for the new using the specified values, but the item is not inserted into the . + + The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. + ]]> @@ -672,29 +672,29 @@ Occurs when the button is clicked for an item in the control. - event is raised when the `Delete` button is clicked for an item in the control. - - A typical handler for the event removes the selected item from the data source and then rebinds the data to the control. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It deletes the selected item in the control when the `Delete` button is clicked. - + event is raised when the `Delete` button is clicked for an item in the control. + + A typical handler for the event removes the selected item from the data source and then rebinds the data to the control. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It deletes the selected item in the control when the `Delete` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -725,11 +725,11 @@ Represents the command name. This field is read-only. - field to represent the `Delete` command name. - + field to represent the `Delete` command name. + ]]> @@ -758,35 +758,35 @@ Occurs when the button is clicked for an item in the control. - event is raised when the `Edit` button is clicked for an item in the control. - - A typical handler for the event sets the property to the selected row and then rebinds the data to the control. - + event is raised when the `Edit` button is clicked for an item in the control. + + A typical handler for the event sets the property to the selected row and then rebinds the data to the control. + > [!CAUTION] -> Text is not HTML encoded before it is displayed in the control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - +> Text is not HTML encoded before it is displayed in the control. This makes it possible to embed script within HTML tags in the text. If the values for the control come from user input, be sure to validate the values to reduce security vulnerabilities. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It allows you to edit the selected item in the control when the `Edit` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It allows you to edit the selected item in the control when the `Edit` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -817,11 +817,11 @@ Represents the command name. This field is read-only. - field to represent the `Edit` command name. - + field to represent the `Edit` command name. + ]]> @@ -857,32 +857,32 @@ Gets or sets the index number of the selected item in the control to edit. The index number of the selected item in the control to edit. - property to programmatically specify the item to edit. You can also use this property to determine the index of the item selected for editing. - + property to programmatically specify the item to edit. You can also use this property to determine the index of the item selected for editing. + > [!NOTE] -> The property is zero based. - - To unselect an item, set the property to `-1`. - +> The property is zero based. + + To unselect an item, set the property to `-1`. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - The property is stored in control state. - - - -## Examples - The following code example demonstrates how to use the property to specify the item selected by the user for editing. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + The property is stored in control state. + + + +## Examples + The following code example demonstrates how to use the property to specify the item selected by the user for editing. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + ]]> The selected value is less than . @@ -932,34 +932,34 @@ Gets the style properties for the item selected for editing in the control. A object that contains the style properties for the item selected for editing in the control. The default value is an empty object. - property to provide a custom style for the item selected for editing in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. - -|Precedence|Style Property| -|----------------|--------------------| -|1|| -|2|| -|3|| -|4|| -|5|| - - To specify a custom style for the item selected for editing, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - - - -## Examples - The following code example demonstrates how to use the property to specify a different appearance for the item selected by the user for editing. - + property to provide a custom style for the item selected for editing in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. + +|Precedence|Style Property| +|----------------|--------------------| +|1|| +|2|| +|3|| +|4|| +|5|| + + To specify a custom style for the item selected for editing, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + + + +## Examples + The following code example demonstrates how to use the property to specify a different appearance for the item selected by the user for editing. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + ]]> @@ -1018,27 +1018,27 @@ Gets or sets the template for the item selected for editing in the control. A object that contains the template for the item selected for editing in the control. The default value is . - property to control the contents of the item selected for editing in the control. The appearance of the item selected for editing is controlled by the property. - - To specify a template for the item selected for editing, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - + property to control the contents of the item selected for editing in the control. The appearance of the item selected for editing is controlled by the property. + + To specify a template for the item selected for editing, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the item selected by the user for editing. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the item selected by the user for editing. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + ]]> @@ -1080,32 +1080,32 @@ if the rows of a control, defined in each template of a control, are extracted and displayed; otherwise, . The default value is . - control are specified by using templates. Normally, you list controls that you want to display in the templates. You can also place a control in a template and display the rows of the table. - - Use the property to specify whether the rows of a control defined in each template of a control are extracted and displayed. All rows extracted from the templates of the control are displayed in a single table. This allows you to create a single table from other smaller tables and still maintain the features of the control. - + control are specified by using templates. Normally, you list controls that you want to display in the templates. You can also place a control in a template and display the rows of the table. + + Use the property to specify whether the rows of a control defined in each template of a control are extracted and displayed. All rows extracted from the templates of the control are displayed in a single table. This allows you to create a single table from other smaller tables and still maintain the features of the control. + > [!NOTE] -> When this property is set to `true`, you must provide a well-formed control for each template you want to include in the control. Only the rows of the tables will be displayed. All other content in the template will be ignored. You must use a control for this feature to work properly. The control is not compatible with this property. - - When you create a cell for a control in a template, you can use the property of the object to control the number of columns the cell spans. You can also use the property to control the number of rows the cell spans. - +> When this property is set to `true`, you must provide a well-formed control for each template you want to include in the control. Only the rows of the tables will be displayed. All other content in the template will be ignored. You must use a control for this feature to work properly. The control is not compatible with this property. + + When you create a cell for a control in a template, you can use the property of the object to control the number of columns the cell spans. You can also use the property to control the number of rows the cell spans. + > [!NOTE] -> The , , and properties do not affect the appearance of the control when this property is set to `true`. - - - -## Examples - The following code example demonstrate how to use the property to extract and display the rows of controls defined in the templates of the control. - +> The , , and properties do not affect the appearance of the control when this property is set to `true`. + + + +## Examples + The following code example demonstrate how to use the property to extract and display the rows of controls defined in the templates of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic DataList.ExtractTemplateRows Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.ExtractTemplateRows Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.ExtractTemplateRows Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1159,29 +1159,29 @@ Gets the style properties for the footer section of the control. A object that contains the style properties for the footer section of the control. The default value is an empty object. - control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - The property of the control inherits the style settings of the property. For example, if you specify a red font for the property, the property will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings by setting the property. For example, you can specify a blue font for the property, overriding the red font specified in the property. - - To specify a custom style for the footer section, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - + control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + The property of the control inherits the style settings of the property. For example, if you specify a red font for the property, the property will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings by setting the property. For example, you can specify a blue font for the property, overriding the red font specified in the property. + + To specify a custom style for the footer section, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + > [!NOTE] -> The property must be set to `true` for this property to be visible. - - - -## Examples - The following code example demonstrates how to use the property to specify a custom background color for the footer section of the control. - +> The property must be set to `true` for this property to be visible. + + + +## Examples + The following code example demonstrates how to use the property to specify a custom background color for the footer section of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListHeaderStyle/CS/datalistheaderstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: + ]]> @@ -1238,32 +1238,32 @@ Gets or sets the template for the footer section of the control. A object that contains the template for the footer section of the control. The default value is . - property to control the contents of the footer section. The appearance of the footer section is controlled by the property. - + property to control the contents of the footer section. The appearance of the footer section is controlled by the property. + > [!NOTE] -> The property must be set to `true` for this property to be visible. - - The property of the control inherits the style settings of the property. For example, if you specify a red font for the property, the property will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings by setting the property. For example, you can specify a blue font for the property, overriding the red font specified in the property. - - To specify a template for the footer section, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - +> The property must be set to `true` for this property to be visible. + + The property of the control inherits the style settings of the property. For example, if you specify a red font for the property, the property will also have a red font. This allows you to provide a common appearance for the control by setting a single style property. You can override the inherited style settings by setting the property. For example, you can specify a blue font for the property, overriding the red font specified in the property. + + To specify a template for the footer section, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the footer section of the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the footer section of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListHeaderStyle/CS/datalistheaderstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: + ]]> @@ -1302,32 +1302,32 @@ Gets or sets the grid line style for the control when the property is set to . One of the enumeration values. The default value is . - property to specify the grid line style for the control. The following table lists the possible styles. - -|Style|Description| -|-----------|-----------------| -||No grid lines.| -||Displays the horizontal grid lines.| -||Displays the vertical grid line.| -||Displays both the horizontal and vertical grid lines.| - + property to specify the grid line style for the control. The following table lists the possible styles. + +|Style|Description| +|-----------|-----------------| +||No grid lines.| +||Displays the horizontal grid lines.| +||Displays the vertical grid line.| +||Displays both the horizontal and vertical grid lines.| + > [!NOTE] -> This property only applies if the property is set to `RepeatLayout.Table`. - - - -## Examples - The following code example demonstrates how to use the property to display the vertical and horizontal grid lines of the control. - +> This property only applies if the property is set to `RepeatLayout.Table`. + + + +## Examples + The following code example demonstrates how to use the property to display the vertical and horizontal grid lines of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> @@ -1373,27 +1373,27 @@ Gets the style properties for the heading section of the control. A object that contains the style properties for the heading section of the control. The default value is an empty object. - control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - To specify a custom style for the heading section, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - + control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + To specify a custom style for the heading section, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + > [!NOTE] -> The property must be set to `true` for this property to be visible. - - - -## Examples - The following code example demonstrates how to use the property to specify a custom background color for the heading section of the control. - +> The property must be set to `true` for this property to be visible. + + + +## Examples + The following code example demonstrates how to use the property to specify a custom background color for the heading section of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListHeaderStyle/CS/datalistheaderstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListHeaderStyle/VB/datalistheaderstylevb.aspx" id="Snippet1"::: + ]]> @@ -1450,30 +1450,30 @@ Gets or sets the template for the heading section of the control. A that contains the template for the heading section of the control. The default value is . - property to control the contents of the heading section. The appearance of the header section is controlled by the property. - + property to control the contents of the heading section. The appearance of the header section is controlled by the property. + > [!NOTE] -> The property must be set to `true` for this property to be visible. - - To specify a template for the heading section, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - +> The property must be set to `true` for this property to be visible. + + To specify a template for the heading section, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the heading section of the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the heading section of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> @@ -1508,15 +1508,15 @@ The to initialize. Initializes a object based on the specified templates and styles for the list-item type. - method is used primarily by control developers to extend the control. - - The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. - - Override the method to customize how controls are created or added to the control. Override the method to customize templates for a control. - + method is used primarily by control developers to extend the control. + + The method uses the and methods to create controls that represent the header, footer, separator, and data-bound items contained in the data list. You can access the data-bound items for the data list through the collection. You can access all item types, including the header, footer, and separator items, through the collection. + + Override the method to customize how controls are created or added to the control. Override the method to customize templates for a control. + ]]> @@ -1543,27 +1543,27 @@ Occurs when any button is clicked in the control. - event is raised when any button is clicked in the control and is commonly used when you have a button control with a custom `CommandName` value. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to select an item from the control. - + event is raised when any button is clicked in the control and is commonly used when you have a button control with a custom `CommandName` value. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to select an item from the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand/CS/datalistitemcommandcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand2/CS/datalistitemcommand2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand2/VB/datalistitemcommand2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand2/VB/datalistitemcommand2vb.aspx" id="Snippet1"::: + ]]> @@ -1592,29 +1592,29 @@ Occurs on the server when an item in the control is created. - event is raised when an item in the control is created, both during round-trips and at the time data is bound to the control. - - The event is commonly used to control the content and appearance of a row in the control. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are created. - + event is raised when an item in the control is created, both during round-trips and at the time data is bound to the control. + + The event is commonly used to control the content and appearance of a row in the control. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are created. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCreated/CS/datalistitemcreatedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated/VB/datalistitemcreatedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated/VB/datalistitemcreatedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCreated2/CS/datalistitemcreated2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated2/VB/datalistitemcreated2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated2/VB/datalistitemcreated2vb.aspx" id="Snippet1"::: + ]]> @@ -1643,27 +1643,27 @@ Occurs when an item is data bound to the control. - event is raised after an item is data bound to the control. This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is no longer available. - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are bound to the control. - + event is raised after an item is data bound to the control. This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is no longer available. + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are bound to the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemDataBound/CS/datalistitemdataboundcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound/VB/datalistitemdataboundvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound/VB/datalistitemdataboundvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemDataBound2/CS/datalistitemdatabound2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound2/VB/datalistitemdatabound2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound2/VB/datalistitemdatabound2vb.aspx" id="Snippet1"::: + ]]> @@ -1703,25 +1703,25 @@ Gets a collection of objects representing the individual items within the control. A that contains a collection of objects representing the individual items within the control. - collection to programmatically control the items in the control. The collection does not provide any methods to add or remove items to the collection. However, you can control the contents of an item by providing a handler for the event. - + collection to programmatically control the items in the control. The collection does not provide any methods to add or remove items to the collection. However, you can control the contents of an item by providing a handler for the event. + > [!NOTE] -> Only items bound to the data source are contained in the collection. The header, footer, and separator are not included in the collection. - - - -## Examples - The following code example demonstrates how to use the collection to display the items in the control. - +> Only items bound to the data source are contained in the collection. The header, footer, and separator are not included in the collection. + + + +## Examples + The following code example demonstrates how to use the collection to display the items in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic DataList.Items Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.Items Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.Items Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1769,36 +1769,36 @@ Gets the style properties for the items in the control. A object that contains the style properties for the items in the control. The default value is an empty object. - control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. - -|Precedence|Style Property| -|----------------|--------------------| -|1|| -|2|| -|3|| -|4|| -|5|| - - To specify a custom style for the items of the control, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - - You can also use the property to provide a different appearance for the alternating items in the control. - - - -## Examples - The following code example demonstrates how to use the property to specify a different background color for the items in the control. - + control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. + +|Precedence|Style Property| +|----------------|--------------------| +|1|| +|2|| +|3|| +|4|| +|5|| + + To specify a custom style for the items of the control, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + + You can also use the property to provide a different appearance for the alternating items in the control. + + + +## Examples + The following code example demonstrates how to use the property to specify a different background color for the items in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemStyle/CS/datalistitemstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemStyle/VB/datalistitemstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemStyle/VB/datalistitemstylevb.aspx" id="Snippet1"::: + ]]> @@ -1855,29 +1855,29 @@ Gets or sets the template for the items in the control. A that contains the template for the items in the control. The default value is . - property to control the contents of the items in the control. The appearance of the items in the control is controlled by the property. - - To specify a template for the items of the control, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - - You can optionally use the property to provide a different appearance for the alternating items in the control. - + property to control the contents of the items in the control. The appearance of the items in the control is controlled by the property. + + To specify a template for the items of the control, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + + You can optionally use the property to provide a different appearance for the alternating items in the control. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the items in the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the items in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> @@ -1912,13 +1912,13 @@ An object that represents the state of the . Loads the previously saved view state of the control. - method restores view-state information for the control from a previous page request that was saved by the method. - + method restores view-state information for the control from a previous page request that was saved by the method. + ]]> @@ -1981,36 +1981,36 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when the `Cancel` button is clicked for an item in the control. - - A typical handler for the event sets the property to `-1` (to deselect the item) and then rebinds the data to the control. - + method to provide a custom handler for the event. + + The event is raised when the `Cancel` button is clicked for an item in the control. + + A typical handler for the event sets the property to `-1` (to deselect the item) and then rebinds the data to the control. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It cancels any edits made to an item in the control when the `Cancel` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It cancels any edits made to an item in the control when the `Cancel` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -2050,33 +2050,33 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when the `Delete` button is clicked for an item in the control. - - A typical handler for the event removes the selected item from the data source and then rebinds the data to the control. - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It deletes the selected item in the control when the `Delete` button is clicked. - + method to provide a custom handler for the event. + + The event is raised when the `Delete` button is clicked for an item in the control. + + A typical handler for the event removes the selected item from the data source and then rebinds the data to the control. + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It deletes the selected item in the control when the `Delete` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -2113,36 +2113,36 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when the `Edit` button is clicked for an item in the control. - - A typical handler for the event sets the property to the selected row and then rebinds the data to the control. - + method to provide a custom handler for the event. + + The event is raised when the `Edit` button is clicked for an item in the control. + + A typical handler for the event sets the property to the selected row and then rebinds the data to the control. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It allows you to edit the selected item in the control when the `Edit` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It allows you to edit the selected item in the control when the `Edit` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -2179,11 +2179,11 @@ An that contains the event data. Raises the event for the control. - method notifies the control to perform any initialization steps that are required to create and set up an instance. - + method notifies the control to perform any initialization steps that are required to create and set up an instance. + ]]> @@ -2213,31 +2213,31 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when any button is clicked in the control and is commonly used when you have a button control with a custom `CommandName` value, such as `Add`, in the control. - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to select an item from the control. - + method to provide a custom handler for the event. + + The event is raised when any button is clicked in the control and is commonly used when you have a button control with a custom `CommandName` value, such as `Add`, in the control. + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to select an item from the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand/CS/datalistitemcommandcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand2/CS/datalistitemcommand2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand2/VB/datalistitemcommand2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand2/VB/datalistitemcommand2vb.aspx" id="Snippet1"::: + ]]> @@ -2273,33 +2273,33 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when an item in the control is created, both during round-trips and at the time data is bound to the control. - - The event is commonly used to control the content and appearance of a row in the control. - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are created. - + method to provide a custom handler for the event. + + The event is raised when an item in the control is created, both during round-trips and at the time data is bound to the control. + + The event is commonly used to control the content and appearance of a row in the control. + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are created. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCreated/CS/datalistitemcreatedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated/VB/datalistitemcreatedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated/VB/datalistitemcreatedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCreated2/CS/datalistitemcreated2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated2/VB/datalistitemcreated2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCreated2/VB/datalistitemcreated2vb.aspx" id="Snippet1"::: + ]]> @@ -2335,31 +2335,31 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised after an item is data bound to the control. This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is no longer available. - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are bound to the control. - + method to provide a custom handler for the event. + + The event is raised after an item is data bound to the control. This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is no longer available. + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to display the order in which items in the control are bound to the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemDataBound/CS/datalistitemdataboundcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound/VB/datalistitemdataboundvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound/VB/datalistitemdataboundvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemDataBound2/CS/datalistitemdatabound2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound2/VB/datalistitemdatabound2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemDataBound2/VB/datalistitemdatabound2vb.aspx" id="Snippet1"::: + ]]> @@ -2395,36 +2395,36 @@ A that contains event data. Raises the event. This allows you to provide a custom handler for the event. - method to provide a custom handler for the event. - - The event is raised when the `Update` button for an item is clicked. - - A typical handler for the event updates the data, sets the property to `-1` (to deselect the item), and then rebinds the data to the control. - + method to provide a custom handler for the event. + + The event is raised when the `Update` button for an item is clicked. + + A typical handler for the event updates the data, sets the property to `-1` (to deselect the item), and then rebinds the data to the control. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It allows you to update the selected item in the control with the new values entered by the user when the `Update` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + Raising an event invokes the event handler through a delegate. For more information, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + The method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It allows you to update the selected item in the control with the new values entered by the user when the `Update` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -2462,13 +2462,13 @@ Prepares the control hierarchy for rendering in the control. - method is used primarily by control developers when deriving a custom control from the control. - - The prepares the control hierarchy and sets styles for contained controls before the child controls are rendered. - + method is used primarily by control developers when deriving a custom control from the control. + + The prepares the control hierarchy and sets styles for contained controls before the child controls are rendered. + ]]> @@ -2505,23 +2505,23 @@ A that represents the output stream to render HTML content on the client. Renders the list items in the control. - method is used primarily by control developers, when deriving a custom control from the control. - - The method renders the inner content of the control, including the contained controls. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that some text precedes the object. - + method is used primarily by control developers, when deriving a custom control from the control. + + The method renders the inner content of the control, including the contained controls. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that some text precedes the object. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDataListRenderContents/CS/custom_datalist_rendercontentscs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListRenderContents/VB/custom_datalist_rendercontentsvb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListRenderContents/VB/custom_datalist_rendercontentsvb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDataListRenderContents/CS/custom_datalist_rendercontents.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListRenderContents/VB/custom_datalist_rendercontents.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDataListRenderContents/VB/custom_datalist_rendercontents.vb" id="Snippet2"::: + ]]> @@ -2557,25 +2557,25 @@ Gets or sets the number of columns to display in the control. The number of columns to display in the control. The default value is , which indicates that the items in the control are displayed in a single row or column, based on the value of the property. - control. For example, if you set this property to `5`, the control displays its items in five columns. - + control. For example, if you set this property to `5`, the control displays its items in five columns. + > [!NOTE] -> If this property is set to `0`, the control displays its items in a single row or column, based on the value of the property. If the property is set to `RepeatDirection.Horizontal`, the items are displayed in a single row. If the property is set to `RepeatDirection.Vertical`, the items are displayed in a single column. - - - -## Examples - The following code example demonstrates how to use the property to specify the number of columns to display in the control. - +> If this property is set to `0`, the control displays its items in a single row or column, based on the value of the property. If the property is set to `RepeatDirection.Horizontal`, the items are displayed in a single row. If the property is set to `RepeatDirection.Vertical`, the items are displayed in a single column. + + + +## Examples + The following code example demonstrates how to use the property to specify the number of columns to display in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> The specified number of columns is a negative value. @@ -2615,41 +2615,39 @@ Gets or sets whether the control displays vertically or horizontally. One of the values. The default is . - property to specify the display direction of the control. - + property to specify the display direction of the control. + > [!NOTE] -> The number of columns displayed is always determined by the property. - - If this property is set to `RepeatDirection.Vertical`, the items in the list are displayed in columns loaded from top to bottom, then left to right, until all items are rendered. For example, if the property is set to `3`, the items in the control are displayed in three columns, as in the following table. - -|||| -|-|-|-| -|1|4|7| -|2|5|8| -|3|6|9| - - If this property is set to `RepeatDirection.Horizontal`, the items in the list are displayed in rows loaded from left to right, then top to bottom, until all items are rendered. For example, if the property is set to `3`, the items of the control are displayed in rows of three items each, as in the following table. - -|||| -|-|-|-| -|1|2|3| -|4|5|6| -|7|8|9| - - - -## Examples - The following code example demonstrates how to use the property to specify the direction in which the control is displayed. - +> The number of columns displayed is always determined by the property. + + If this property is set to `RepeatDirection.Vertical`, the items in the list are displayed in columns loaded from top to bottom, then left to right, until all items are rendered. For example, if the property is set to `3`, the items in the control are displayed in three columns, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 4 | 7 | +| 2 | 5 | 8 | +| 3 | 6 | 9 | + + If this property is set to `RepeatDirection.Horizontal`, the items in the list are displayed in rows loaded from left to right, then top to bottom, until all items are rendered. For example, if the property is set to `3`, the items of the control are displayed in rows of three items each, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + +## Examples + The following code example demonstrates how to use the property to specify the direction in which the control is displayed. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> The specified value is not one of the values. @@ -2690,26 +2688,26 @@ Gets or sets whether the control is displayed in a table or flow layout. A value that specifies whether the control is displayed in a table or in flow layout. - property to specify whether the items in the control are displayed in a table. The only values that are supported by the control are and . - - If this property is set to `RepeatLayout.Table`, the items in the list are displayed in a table. If this property is set to `RepeatLayout.Flow`, the items in the list are displayed without a table structure. - - When the control is displayed in a table, you can use the property to specify a grid line style. - - - -## Examples - The following code example demonstrates how to use the property to specify the layout style of the control. - + property to specify whether the items in the control are displayed in a table. The only values that are supported by the control are and . + + If this property is set to `RepeatLayout.Table`, the items in the list are displayed in a table. If this property is set to `RepeatLayout.Flow`, the items in the list are displayed without a table structure. + + When the control is displayed in a table, you can use the property to specify a grid line style. + + + +## Examples + The following code example demonstrates how to use the property to specify the layout style of the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> The specified value is not one of the supported values. @@ -2741,15 +2739,15 @@ Saves the changes to the control view state since the time the page was posted back to the server. The object that contains the changes to the view state. - method is used primarily by control developers. - - View state is the accumulation of the values of a server control's properties. These values are automatically placed in the server control's property, which is an instance of the class. The property's value is then persisted to a string object after the save-state stage of the server control's life cycle. For more information, see [ASP.NET Page Life Cycle Overview](https://learn.microsoft.com/previous-versions/aspnet/ms178472(v=vs.100)). - - When view state is saved, this string object is returned to the client as a variable that is stored in a hidden HTML input element. When you author custom server controls, you can improve efficiency by overriding the method and modifying the property for your server control. For more information, see [Developing Custom ASP.NET Server Controls](https://learn.microsoft.com/previous-versions/aspnet/zt27tfhy(v=vs.100)) and [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). - + method is used primarily by control developers. + + View state is the accumulation of the values of a server control's properties. These values are automatically placed in the server control's property, which is an instance of the class. The property's value is then persisted to a string object after the save-state stage of the server control's life cycle. For more information, see [ASP.NET Page Life Cycle Overview](https://learn.microsoft.com/previous-versions/aspnet/ms178472(v=vs.100)). + + When view state is saved, this string object is returned to the client as a variable that is stored in a hidden HTML input element. When you author custom server controls, you can improve efficiency by overriding the method and modifying the property for your server control. For more information, see [Developing Custom ASP.NET Server Controls](https://learn.microsoft.com/previous-versions/aspnet/zt27tfhy(v=vs.100)) and [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). + ]]> @@ -2777,11 +2775,11 @@ Represents the command name. This field is read-only. - field to represent the `Select` command name. - + field to represent the `Select` command name. + ]]> @@ -2821,29 +2819,29 @@ Gets or sets the index of the selected item in the control. The index of the selected item in the control. - property to programmatically specify the selected item in the control. You can also use this property to determine the index of the selected item. - + property to programmatically specify the selected item in the control. You can also use this property to determine the index of the selected item. + > [!NOTE] -> The property is zero based. - - To deselect an item, set the property to `-1`. - - The property is stored in control state. - - - -## Examples - The following code example demonstrates how to use the property to specify the selected item in the control. - +> The property is zero based. + + To deselect an item, set the property to `-1`. + + The property is stored in control state. + + + +## Examples + The following code example demonstrates how to use the property to specify the selected item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand/CS/datalistitemcommandcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: + ]]> The specified value is less than . @@ -2883,22 +2881,22 @@ Gets the selected item in the control. A that represents the item selected in the control. - property to get a object that represents the selected item in the control. This object can then be used to access the properties of the selected item. - - - -## Examples - The following code example demonstrates how to use the property to display the contents of the selected item in the control. - + property to get a object that represents the selected item in the control. This object can then be used to access the properties of the selected item. + + + +## Examples + The following code example demonstrates how to use the property to display the contents of the selected item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic DataList.SelectedItem Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.SelectedItem Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic DataList.SelectedItem Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -2946,34 +2944,34 @@ Gets the style properties for the selected item in the control. A object that contains the style properties for the selected item in the control. The default value is an empty object. - control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. - -|Precedence|Style Property| -|----------------|--------------------| -|1|| -|2|| -|3|| -|4|| -|5|| - - To specify a custom style for the selected item, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - - - -## Examples - The following code example demonstrates how to use the property to specify a custom background color for the selected item in the control. - + control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + Item style properties in the control are inherited from one item style property to another through a hierarchy. Item style properties set lower in the hierarchy are inherited by item style properties higher in the hierarchy. For example, if you specify a red font for the property, all other item style properties in the control will also have a red font. This allows you to provide a common appearance for the control by setting a single item style property. You can override the inherited style settings for an item style property that is higher in the hierarchy by setting its style properties. For example, you can specify a blue font for the property, overriding the red font specified in the property. The following table lists the hierarchy order from highest to lowest. + +|Precedence|Style Property| +|----------------|--------------------| +|1|| +|2|| +|3|| +|4|| +|5|| + + To specify a custom style for the selected item, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + + + +## Examples + The following code example demonstrates how to use the property to specify a custom background color for the selected item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand/CS/datalistitemcommandcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: + ]]> @@ -3030,27 +3028,27 @@ Gets or sets the template for the selected item in the control. A that contains the template for the selected item in the control. The default value is . - property to control the contents of the selected item. The appearance of the selected item is controlled by the property. - - To specify a template for the selected item, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - + property to control the contents of the selected item. The appearance of the selected item is controlled by the property. + + To specify a template for the selected item, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the selected item in the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the selected item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListItemCommand/CS/datalistitemcommandcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListItemCommand/VB/datalistitemcommandvb.aspx" id="Snippet1"::: + ]]> @@ -3131,24 +3129,24 @@ Gets the style properties of the separator between each item in the control. A object that contains the style properties of the separator between each item in the control. The default value is an empty object. - property to provide a custom style for the separator between each item in the control. The separator allows you to place an element with custom content between each item in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. - - To specify a custom style for the separator, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. - - - -## Examples - The following code example demonstrates how to use the property to specify a custom background color for the separator between each item in the control. - + property to provide a custom style for the separator between each item in the control. The separator allows you to place an element with custom content between each item in the control. Common style attributes that can be adjusted include foreground color, background color, font, and content alignment within the cell. Providing a different style enhances the appearance of the control. + + To specify a custom style for the separator, place the `` tags between the opening and closing tags of the control. You can then list the style attributes within the opening `` tag. + + + +## Examples + The following code example demonstrates how to use the property to specify a custom background color for the separator between each item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListSeparatorStyle/CS/datalistseparatorstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListSeparatorStyle/VB/datalistseparatorstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListSeparatorStyle/VB/datalistseparatorstylevb.aspx" id="Snippet1"::: + ]]> @@ -3203,27 +3201,27 @@ Gets or sets the template for the separator between the items of the control. A that contains the template for the separator between items in the control. The default value is . - property to control the contents of the separator between the items of the control. The separator allows you to place an element with custom content between each item in the control. The appearance of the separator between the items of the control is controlled by the property. - - To specify a template for the separator, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. - + property to control the contents of the separator between the items of the control. The separator allows you to place an element with custom content between each item in the control. The appearance of the separator between the items of the control is controlled by the property. + + To specify a template for the separator, place the `` tags between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing `` tags. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to control the contents of the separator between each item in the control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to control the contents of the separator between each item in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListSeparatorStyle/CS/datalistseparatorstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListSeparatorStyle/VB/datalistseparatorstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListSeparatorStyle/VB/datalistseparatorstylevb.aspx" id="Snippet1"::: + ]]> @@ -3263,24 +3261,24 @@ if the footer section is displayed; otherwise, . The default value is , however this property is only examined when the property is not . - property to specify whether the footer section is displayed in the control. - - You can control the appearance of the footer section by setting the property. The contents of the footer section are controlled by the property. - - - -## Examples - The following code example demonstrates how to use the property to display the footer section in the control. - + property to specify whether the footer section is displayed in the control. + + You can control the appearance of the footer section by setting the property. The contents of the footer section are controlled by the property. + + + +## Examples + The following code example demonstrates how to use the property to display the footer section in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListShowHeader/CS/datalistshowheadercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListShowHeader/VB/datalistshowheadervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListShowHeader/VB/datalistshowheadervb.aspx" id="Snippet1"::: + ]]> @@ -3319,24 +3317,24 @@ if the header is displayed; otherwise, . The default value is , however this property is only examined when the property is not . - property to specify whether the header section is displayed in the control. - - You can control appearance of the header section by setting the property. The contents of the header section are controlled by the property. - - - -## Examples - The following code example demonstrates how to use the property to display the header section in the control. - + property to specify whether the header section is displayed in the control. + + You can control appearance of the header section by setting the property. The contents of the header section are controlled by the property. + + + +## Examples + The following code example demonstrates how to use the property to display the header section in the control. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListShowHeader/CS/datalistshowheadercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListShowHeader/VB/datalistshowheadervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListShowHeader/VB/datalistshowheadervb.aspx" id="Snippet1"::: + ]]> @@ -3374,11 +3372,11 @@ For a description of this member, see . A that represents the style of the specified item type at the specified index in the list control. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3407,11 +3405,11 @@ if the list control contains a footer section; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3440,11 +3438,11 @@ if the list control contains a heading section; otherwise, . - instance is cast an interface. - + instance is cast an interface. + ]]> @@ -3473,11 +3471,11 @@ if the list control contains a separator; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3515,11 +3513,11 @@ The object to use to render the item. For a description of this member, see . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3547,11 +3545,11 @@ For a description of this member, see . The number of items in the list control. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3576,11 +3574,11 @@ Gets the HTML tag that is used to render the control. Returns the tag if the is set to ; otherwise, returns the tag. The default is . - property to determine the value that is associated with a control. The property is used primarily by control developers. - + property to determine the value that is associated with a control. The property is used primarily by control developers. + ]]> @@ -3606,11 +3604,11 @@ Tracks view-state changes to the control so they can be stored in the control's property. - method is overridden to mark the starting point at which to begin tracking and saving changes to the control as part of the control's view state. - + method is overridden to mark the starting point at which to begin tracking and saving changes to the control as part of the control's view state. + ]]> Control State vs. View State Sample @@ -3636,32 +3634,32 @@ Occurs when the button is clicked for an item in the control. - event is raised when the `Update` button for an item is clicked. - - A typical handler for the event updates the data, sets the property to `-1` (to deselect the item), and then rebinds the data to the control. - + event is raised when the `Update` button for an item is clicked. + + A typical handler for the event updates the data, sets the property to `-1` (to deselect the item), and then rebinds the data to the control. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It allows you to update the selected item in the control with the new values entered by the user when the `Update` button is clicked. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + For more information about handling events, see [How to: Consume Events in a Web Forms Application](/dotnet/standard/events/how-to-consume-events-in-a-web-forms-application). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It allows you to update the selected item in the control with the new values entered by the user when the `Update` button is clicked. + > [!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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> 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 on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit/CS/datalisteditcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit/VB/datalisteditvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListEdit2/CS/datalistedit2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListEdit2/VB/datalistedit2vb.aspx" id="Snippet1"::: + ]]> @@ -3693,11 +3691,11 @@ Represents the command name. This field is read-only. - field to represent the `Update` command name. - + field to represent the `Update` command name. + ]]> diff --git a/xml/System.Web.UI.WebControls/Parameter.xml b/xml/System.Web.UI.WebControls/Parameter.xml index 4f194d85973..398e2919c02 100644 --- a/xml/System.Web.UI.WebControls/Parameter.xml +++ b/xml/System.Web.UI.WebControls/Parameter.xml @@ -37,15 +37,15 @@ Use classes that derive from with data source and data-bound controls to build Web-based data applications. These parameter classes are used by data source controls to bind specific kinds of values found in Web applications to placeholders in SQL query strings, business object method parameters, and more. The following table lists parameter types that are included in ASP.NET. -||| -|-|-| -||Binds any public property of a Web server control.| -||Binds a form field.| -||Binds a session-state field.| -||Binds a route URL parameter.| -||Binds a cookie field.| -||Binds a query-string parameter.| -||Binds a profile field.| +| Parameter type | Description | +|-------------------------------------------------------|----------------------------------------------------| +| | Binds any public property of a Web server control. | +| | Binds a form field. | +| | Binds a session-state field. | +| | Binds a route URL parameter. | +| | Binds a cookie field. | +| | Binds a query-string parameter. | +| | Binds a profile field. | Extend the base class when you want to implement your own custom parameter types. diff --git a/xml/System.Web.UI.WebControls/RadioButtonList.xml b/xml/System.Web.UI.WebControls/RadioButtonList.xml index d19b5fb33a0..05c13210b1a 100644 --- a/xml/System.Web.UI.WebControls/RadioButtonList.xml +++ b/xml/System.Web.UI.WebControls/RadioButtonList.xml @@ -38,117 +38,117 @@ Represents a list control that encapsulates a group of radio button controls. - -## Introduction - The control provides page developers with a single-selection radio button group that can be dynamically generated through data binding. It contains an collection with members that correspond to individual items on the list. To determine which item is selected, test the property of the list. - - -## Specifying List Layout - You can specify how the list is rendered by setting the and properties. For information about layout options, see the enumeration. - - By default, is set to `RepeatDirection.Vertical`. Setting this property to `RepeatDirection.Horizontal` causes the control to render the list horizontally. Some settings do not allow horizontal layout. For more information, see the enumeration. - + +## Introduction + The control provides page developers with a single-selection radio button group that can be dynamically generated through data binding. It contains an collection with members that correspond to individual items on the list. To determine which item is selected, test the property of the list. + + +## Specifying List Layout + You can specify how the list is rendered by setting the and properties. For information about layout options, see the enumeration. + + By default, is set to `RepeatDirection.Vertical`. Setting this property to `RepeatDirection.Horizontal` causes the control to render the list horizontally. Some settings do not allow horizontal layout. For more information, see the enumeration. + > [!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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). - - -## Accessibility - For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)) and [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). - - -## Declarative Syntax - -``` - -             - -``` - - - -## Examples - The following code example demonstrates how to programmatically modify the display of a control. - +> 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](https://learn.microsoft.com/previous-versions/aspnet/ms178270(v=vs.100)), [How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings](https://learn.microsoft.com/previous-versions/aspnet/a2a4yykt(v=vs.100)), and [Validating User Input in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/7kh55542(v=vs.100)). + + +## Accessibility + For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)) and [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). + + +## Declarative Syntax + +``` + +             + +``` + + + +## Examples + The following code example demonstrates how to programmatically modify the display of a control. + > [!NOTE] -> The following code example uses the single-file code model and might not work correctly if copied directly into a code-behind file. This code example must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). - +> The following code example uses the single-file code model and might not work correctly if copied directly into a code-behind file. This code example must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see [ASP.NET Web Forms Page Code Model](https://learn.microsoft.com/previous-versions/aspnet/015103yb(v=vs.100)). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -175,11 +175,11 @@ Initializes a new instance of the class. - class. - + class. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -216,23 +216,23 @@ Gets or sets the distance (in pixels) between the border and the contents of the table cell. The distance (in pixels) between the border and the contents of the table cell. The default is -1, which indicates that this property is not set. - property is set to `RepeatLayout.Table`. - - Use this property to control the spacing between the contents of a cell and the cell's border. - - The padding amount specified is added to all four sides of a cell. It uses the height of the tallest cell in the table and the width of the widest cell in the table. The resulting cell size is applied uniformly to all cells in the table. Individual cell sizes cannot be specified. - - - -## Examples - The following code example demonstrates how to use the property to pad the cells of a control with 10 pixels. - + property is set to `RepeatLayout.Table`. + + Use this property to control the spacing between the contents of a cell and the cell's border. + + The padding amount specified is added to all four sides of a cell. It uses the height of the tallest cell in the table and the width of the widest cell in the table. The resulting cell size is applied uniformly to all cells in the table. Individual cell sizes cannot be specified. + + + +## Examples + The following code example demonstrates how to use the property to pad the cells of a control with 10 pixels. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -270,21 +270,21 @@ Gets or sets the distance (in pixels) between adjacent table cells. The distance (in pixels) between adjacent table cells. The default is -1, which indicates that this property is not set. - property is set to `RepeatLayout.Table`. - - Use this property to control the spacing between individual cells in the table. This property is applied both vertically and horizontally. - - - -## Examples - The following code example demonstrates how to use the property to space the cells of a control apart by 10 pixels. - + property is set to `RepeatLayout.Table`. + + Use this property to control the spacing between individual cells in the table. This property is applied both vertically and horizontally. + + + +## Examples + The following code example demonstrates how to use the property to space the cells of a control apart by 10 pixels. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.CellSpacing Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.CellSpacing Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.CellSpacing Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -313,21 +313,21 @@ Creates a style object that is used internally by the control to implement all style-related properties. A that contains the style properties of the control. - method is used primarily by control developers in custom control that derive from the class. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that it always returns an empty object for the control. - + method is used primarily by control developers in custom control that derive from the class. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that it always returns an empty object for the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/CS/custom_radiobuttonlist_createcontrolstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/VB/custom_radiobuttonlist_createcontrolstylevb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/VB/custom_radiobuttonlist_createcontrolstylevb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/CS/custom_radiobuttonlist_createcontrolstyle.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/VB/custom_radiobuttonlist_createcontrolstyle.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListCreateControlStyle/VB/custom_radiobuttonlist_createcontrolstyle.vb" id="Snippet2"::: + ]]> RadioButton and RadioButtonList Web Server Controls @@ -359,13 +359,13 @@ Searches the current naming container for a server control with the specified ID and path offset. The method always returns the object. The current . - method is used primarily by control developers in custom controls that derive from the class. - - The method overrides the method of the base class. You should not override this version of the method. - + method is used primarily by control developers in custom controls that derive from the class. + + The method overrides the method of the base class. You should not override this version of the method. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -398,13 +398,13 @@ , indicating that style attributes are not set on individual list items in a control. - method is used primarily by control developers in custom controls that derive from the class. - - The style attribute for the control applies to all list items that are contained by the control. Use the property of the control to examine or set the style attribute for the control and its list items. - + method is used primarily by control developers in custom controls that derive from the class. + + The style attribute for the control applies to all list items that are contained by the control. Use the property of the control to examine or set the style attribute for the control and its list items. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -431,11 +431,11 @@ , indicating that the does not contain a footer section. - property is used primarily by control developers in custom controls that derive from the class. Footers are not supported when the property is set to or . - + property is used primarily by control developers in custom controls that derive from the class. Footers are not supported when the property is set to or . + ]]> RadioButton and RadioButtonList Web Server Controls @@ -462,11 +462,11 @@ , indicating that a control does not contain a heading section. - property is used primarily by control developers in custom controls that derive from the class. Headers are not supported when the property is set to or . - + property is used primarily by control developers in custom controls that derive from the class. Headers are not supported when the property is set to or . + ]]> RadioButton and RadioButtonList Web Server Controls @@ -493,11 +493,11 @@ , indicating that a control does not contain separators. - property is used primarily by control developers in custom controls that derive from the class. Separators are not supported when the property is set to or . - + property is used primarily by control developers in custom controls that derive from the class. Separators are not supported when the property is set to or . + ]]> RadioButton and RadioButtonList Web Server Controls @@ -530,15 +530,15 @@ if the state of the is different from the last posting; otherwise, . - method is used primarily by control developers in custom controls that derive from the class. - - The method indicates whether the state of the control has changed. In other words, it determines whether the selected list item in the control is the same as the last posted value. A user changing the selected item in the control changes the value for the control. If the same list item is selected in the control, or if the control is disabled, returns `false`. - - When the method returns `true` for a control, the ASP.NET page framework invokes the method for the control. - + method is used primarily by control developers in custom controls that derive from the class. + + The method indicates whether the state of the control has changed. In other words, it determines whether the selected list item in the control is the same as the last posted value. A user changing the selected item in the control changes the value for the control. If the same list item is selected in the control, or if the control is disabled, returns `false`. + + When the method returns `true` for a control, the ASP.NET page framework invokes the method for the control. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -588,15 +588,15 @@ Notifies the ASP.NET application that the state of the control has changed. - method is used primarily by control developers in custom controls that derive from the class. - - The ASP.NET page framework calls the method on a control when the method indicates that the state of the list items have changed in the control. The method calls the method to raise the event. Control developers can override the method to perform custom processing when the user changes the selected item in the control. - - The `RaisePostBackEvent` method can optionally perform validation before raising the event for the control. To validate a group of controls on the page when a list item within the control is selected, set the and properties to `true`, and then specify the group of controls to be validated in the property. - + method is used primarily by control developers in custom controls that derive from the class. + + The ASP.NET page framework calls the method on a control when the method indicates that the state of the list items have changed in the control. The method calls the method to raise the event. Control developers can override the method to perform custom processing when the user changes the selected item in the control. + + The `RaisePostBackEvent` method can optionally perform validation before raising the event for the control. To validate a group of controls on the page when a list item within the control is selected, set the and properties to `true`, and then specify the group of controls to be validated in the property. + ]]> @@ -632,23 +632,23 @@ A that contains the output stream for rendering on the client. Displays the control on the client. - class. - - The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio button list items. - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that the control is always displayed with descriptive text. - + class. + + The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio button list items. + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that the control is always displayed with descriptive text. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomRadioButtonListRender/CS/custom_radiobuttonlist_rendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListRender/VB/custom_radiobuttonlist_rendervb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListRender/VB/custom_radiobuttonlist_rendervb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomRadioButtonListRender/CS/custom_radiobuttonlist_render.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListRender/VB/custom_radiobuttonlist_render.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomRadioButtonListRender/VB/custom_radiobuttonlist_render.vb" id="Snippet2"::: + ]]> RadioButton and RadioButtonList Web Server Controls @@ -683,15 +683,15 @@ A that represents the output stream to render HTML content on the client. Renders a list item in the control. - class. - - The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio-button list items. - - The method for a control ignores the `itemType` and `repeatInfo` parameters. The `repeatIndex` parameter value is used to select the radio button list item in the collection, and the selected list item is rendered to the output stream. - + class. + + The method implementation for a control initializes a object for the list, and calls the method, which in turn uses the method to render individual radio-button list items. + + The method for a control ignores the `itemType` and `repeatInfo` parameters. The `repeatIndex` parameter value is used to select the radio button list item in the collection, and the selected list item is rendered to the output stream. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -760,19 +760,19 @@ Gets or sets the number of columns to display in the control. The number of columns to display in the . The default is 0, which indicates that this property is not set. - property is set to , you can use this property to specify the number of columns that display items in the control. If this property is not set, the control displays all items in the list in a single column. - - - -## Examples - The following code example demonstrates how to use the property to display the items of a control in two columns. - + property is set to , you can use this property to specify the number of columns that display items in the control. If this property is not set, the control displays all items in the list in a single column. + + + +## Examples + The following code example demonstrates how to use the property to display the items of a control in two columns. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.RepeatColumns Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatColumns Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatColumns Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> The number of columns is set to a negative value. @@ -812,38 +812,36 @@ Gets or sets the direction in which the radio buttons within the group are displayed. One of the values. The default is . - control. - + control. + > [!NOTE] -> The number of columns that are displayed is always determined by the property. - - If this property is set to `RepeatDirection.Vertical` and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if is set to 3, the items of the control are displayed in three columns. A nine-item list would appear as follows. - -|||| -|-|-|-| -|1|4|7| -|2|5|8| -|3|6|9| - - If this property is set to `RepeatDirection.Horizontal` and if the property is set to , the items in the list are displayed in rows loaded left to right, then top to bottom, until all items are rendered. For example, if is set to 3, the items of the control are displayed in rows of three items. A nine-item list would appear as follows. - -|||| -|-|-|-| -|1|2|3| -|4|5|6| -|7|8|9| - - - -## Examples - The following code example demonstrates how to use the property to display the items of a control in columns filled top to bottom, and then left to right. - +> The number of columns that are displayed is always determined by the property. + + If this property is set to `RepeatDirection.Vertical` and if the property is set to , the first column is filled from top to bottom, then the next column, and so on until all items are rendered. For example, if is set to 3, the items of the control are displayed in three columns. A nine-item list would appear as follows. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 4 | 7 | +| 2 | 5 | 8 | +| 3 | 6 | 9 | + + If this property is set to `RepeatDirection.Horizontal` and if the property is set to , the items in the list are displayed in rows loaded left to right, then top to bottom, until all items are rendered. For example, if is set to 3, the items of the control are displayed in rows of three items. A nine-item list would appear as follows. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + +## Examples + The following code example demonstrates how to use the property to display the items of a control in columns filled top to bottom, and then left to right. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.RepeatDirection Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatDirection Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatDirection Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> The display direction of the list is not one of the values. @@ -872,13 +870,13 @@ Gets the number of list items in the control. The number of items in the list control. - property is used primarily by control developers in custom controls that derive from the class. - - If there are no items set in the control, the property is zero. If there are items set in the control, the property is the same as the property on the collection. - + property is used primarily by control developers in custom controls that derive from the class. + + If there are no items set in the control, the property is zero. If there are items set in the control, the property is the same as the property on the collection. + ]]> RadioButton and RadioButtonList Web Server Controls @@ -915,24 +913,24 @@ Gets or sets a value that specifies whether the list will be rendered by using a element, a element, an element, or a element. A value that specifies whether the list will be rendered by using a element, a element, an element, or a element. The default is . - enumeration. - + enumeration. + > [!NOTE] -> Two options are new as of ASP.NET 4: and . - - Some settings do not allow horizontal layout. For more information, see the enumeration. - - - -## Examples - The following code example demonstrates how to use the property to display the items of a control in a table. - +> Two options are new as of ASP.NET 4: and . + + Some settings do not allow horizontal layout. For more information, see the enumeration. + + + +## Examples + The following code example demonstrates how to use the property to display the items of a control in a table. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.RepeatLayout Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatLayout Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic RadioButtonList.RepeatLayout Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> The radio button layout is not one of the values. @@ -978,13 +976,13 @@ if the server control's state changed as a result of the postback; otherwise, . - method to process posted data for a control. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to process posted data for a control. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1024,13 +1022,13 @@ Raised when posted data for a control has changed. - method to raise an event when the posted data for a control changes. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to raise an event when the posted data for a control changes. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1076,13 +1074,13 @@ Retrieves the style of the specified item type at the specified index in the list control. A that represents the style of the specified item type at the specified index in the list control. - method to retrieve the style of an item in a control. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to retrieve the style of an item in a control. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1122,11 +1120,11 @@ if the list control contains a footer section; otherwise, . - instance is cast to the interface. - + instance is cast to the interface. + ]]> @@ -1164,11 +1162,11 @@ if the list control contains a header section; otherwise, . - instance is cast to the interface. - + instance is cast to the interface. + ]]> @@ -1206,11 +1204,11 @@ if the list control contains has separators; otherwise, . - instance is cast to the interface. - + instance is cast to the interface. + ]]> @@ -1257,13 +1255,13 @@ A that represents the output stream to render HTML content on the client. Renders an item in the list with the specified information. - method to render items in a control. - - The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. - + method to render items in a control. + + The method is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -1302,11 +1300,11 @@ Gets the number of items in the list control. The number of items in the control. - instance is cast to the interface. - + instance is cast to the interface. + ]]> @@ -1345,18 +1343,18 @@ Gets or sets the text alignment for the radio buttons within the group. One of the values. The default is . - property to display the text associated with the radio buttons on the left side of the control. - - :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.TextAlign Example/CS/sourcecs.aspx" id="Snippet1"::: - + property to display the text associated with the radio buttons on the left side of the control. + + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic RadioButtonList.TextAlign Example/CS/sourcecs.aspx" id="Snippet1"::: + ]]> The label text alignment associated with the radio buttons is not one of the values. diff --git a/xml/System.Web.UI.WebControls/RepeatDirection.xml b/xml/System.Web.UI.WebControls/RepeatDirection.xml index 60f2bb2158f..94b9bb3b348 100644 --- a/xml/System.Web.UI.WebControls/RepeatDirection.xml +++ b/xml/System.Web.UI.WebControls/RepeatDirection.xml @@ -17,36 +17,34 @@ Specifies the direction in which items of a list control are displayed. - enumeration represents the different directions in which the items of a list control can be displayed. - + enumeration represents the different directions in which the items of a list control can be displayed. + > [!NOTE] -> The number of columns displayed is always determined by the `RepeatColumns` property of the list control. - - Horizontal specifies that the items of a list control are displayed in rows loaded from left to right, then top to bottom, until all items are rendered. For example, if the `RepeatColumns` property of the list control is set to three, the items of the list control are displayed in three columns. - -|||| -|-|-|-| -|1|2|3| -|4|5|6| -|7|8|| - - Vertical specifies that the items of a list control are displayed in columns loaded from top to bottom, then left to right, until all items are rendered. For example, if the `RepeatColumns` property of the list control is set to three, the items of the list control are displayed in rows of three items. - -|||| -|-|-|-| -|1|4|7| -|2|5|8| -|3|6|| - - - -## Examples +> The number of columns displayed is always determined by the `RepeatColumns` property of the list control. + + Horizontal specifies that the items of a list control are displayed in rows loaded from left to right, then top to bottom, until all items are rendered. For example, if the `RepeatColumns` property of the list control is set to three, the items of the list control are displayed in three columns. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | | + + Vertical specifies that the items of a list control are displayed in columns loaded from top to bottom, then left to right, until all items are rendered. For example, if the `RepeatColumns` property of the list control is set to three, the items of the list control are displayed in rows of three items. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 4 | 7 | +| 2 | 5 | 8 | +| 3 | 6 | | + +## Examples :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DataListLayout/CS/datalistlayoutcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DataListLayout/VB/datalistlayoutvb.aspx" id="Snippet1"::: + ]]> diff --git a/xml/System.Web.UI.WebControls/RepeatInfo.xml b/xml/System.Web.UI.WebControls/RepeatInfo.xml index 0a7cb4a582d..1eb856e6c60 100644 --- a/xml/System.Web.UI.WebControls/RepeatInfo.xml +++ b/xml/System.Web.UI.WebControls/RepeatInfo.xml @@ -18,13 +18,13 @@ Encapsulates the information used to render a list control that repeats a list of items. This class cannot be inherited. - class encapsulates the information used to render a list control that repeats a list of items, such as , , and . It is primarily used by control developers. - - For a list of initial property values for an instance of , see the constructor. - + class encapsulates the information used to render a list control that repeats a list of items, such as , , and . It is primarily used by control developers. + + For a list of initial property values for an instance of , see the constructor. + ]]> @@ -49,20 +49,20 @@ Initializes a new instance of the class. - class using default values. - - The following table shows initial property values for an instance of . - -|Property|Initial Value| -|--------------|-------------------| -|OuterTableImplied|`false`| -|RepeatColumns|`0`| -|RepeatDirection|| -|RepeatLayout|| - + class using default values. + + The following table shows initial property values for an instance of . + +|Property|Initial Value| +|--------------|-------------------| +|OuterTableImplied|`false`| +|RepeatColumns|`0`| +|RepeatDirection|| +|RepeatLayout|| + ]]> @@ -124,11 +124,11 @@ Gets or sets the alignment of the caption, if the is rendered as a . A value for the rendered table. The default value is . - property of the rendered . - + property of the rendered . + ]]> The selected value is not one of the values. @@ -167,11 +167,11 @@ if the items should be rendered as if they are contained in a table; otherwise, . - property to specify whether items should be rendered as if they are contained in a table. - + property to specify whether items should be rendered as if they are contained in a table. + ]]> @@ -208,11 +208,11 @@ The control from which to copy base attributes. Renders a list control that repeats a list of items, using the specified information. - method to render a list control that repeats a list of items, using the specified information. - + method to render a list control that repeats a list of items, using the specified information. + ]]> @@ -251,11 +251,11 @@ Gets or sets the number of columns to render. The number of columns to render. - property to specify the number of columns to render in the control. - + property to specify the number of columns to render in the control. + ]]> @@ -288,30 +288,30 @@ Gets or sets a value that specifies whether the items are displayed vertically or horizontally. One of the enumeration values. - property to specify the direction that the items are rendered. - + property to specify the direction that the items are rendered. + > [!NOTE] -> The number of columns displayed is always determined by the property. - - If this property is set to `RepeatDirection.Vertical`, the items in the list are displayed in columns loaded top to bottom, then left to right, until all items are rendered. For example, if the property is set to `3`, the items are displayed in three columns, as in the following table. - -|||| -|-|-|-| -|1|4|7| -|2|5|8| -|3|6|9| - - If this property is set to `RepeatDirection.Horizontal`, the items in the list are displayed in rows loaded left to right, then top to bottom, until all items are rendered. For example, if the property is set to `3`, the items are displayed in rows of three items each, as in the following table. - -|||| -|-|-|-| -|1|2|3| -|4|5|6| -|7|8|9| - +> The number of columns displayed is always determined by the property. + + If this property is set to `RepeatDirection.Vertical`, the items in the list are displayed in columns loaded top to bottom, then left to right, until all items are rendered. For example, if the property is set to `3`, the items are displayed in three columns, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 4 | 7 | +| 2 | 5 | 8 | +| 3 | 6 | 9 | + + If this property is set to `RepeatDirection.Horizontal`, the items in the list are displayed in rows loaded left to right, then top to bottom, until all items are rendered. For example, if the property is set to `3`, the items are displayed in rows of three items each, as in the following table. + +| Column 1 | Column 2 | Column 3 | +|----------|----------|----------| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +| 7 | 8 | 9 | + ]]> The specified direction is not one of the enumeration values. @@ -345,11 +345,11 @@ Gets or sets a value specifying whether items are displayed in a table. One of the enumeration values. - property to specify whether the items are displayed in a table. If this property is set to , the items in the list are displayed in a table. If this property is set to , the items in the list are displayed without a table structure. - + property to specify whether the items are displayed in a table. If this property is set to , the items in the list are displayed in a table. If this property is set to , the items in the list are displayed without a table structure. + ]]> The specified layout is not one of the enumeration values. @@ -389,11 +389,11 @@ if a "scope" attribute is to be added, otherwise, . - , a "scope" attribute with value "col" is added and a table header cell (\) is rendered instead of a table cell (\) for the header cells when the is rendered. This attribute can be used by screen readers. - + , a "scope" attribute with value "col" is added and a table header cell (\) is rendered instead of a table cell (\) for the header cells when the is rendered. This attribute can be used by screen readers. + ]]> diff --git a/xml/System.Web.UI/ChtmlTextWriter.xml b/xml/System.Web.UI/ChtmlTextWriter.xml index 798cbb58fbb..97d6ad70303 100644 --- a/xml/System.Web.UI/ChtmlTextWriter.xml +++ b/xml/System.Web.UI/ChtmlTextWriter.xml @@ -17,35 +17,27 @@ Writes a series of cHTML-specific characters and text to the output stream of an ASP.NET server control. The class provides formatting capabilities that ASP.NET server controls use when rendering cHTML content to clients. - class derives from the class and much of its functionality is provided by the and the base class for all markup text writers, which is the class. - - - -## Examples - The following code example demonstrates how to create a class named `CustomChtmlTextWriter` that is derived from the class. It creates two constructors and overrides the method to prevent the `bgcolor` style attribute from being written to the output stream of the object. It also creates a class named `ChtmlCustomPageAdapter` that defines one method, `CreateCustomChtmlTextWriter`, which creates and returns an instance of the `CustomChtmlTextWriter` class. The `CustomChtmlTextWriter` then renders cHTML content for a page to devices with browsers that use cHTML markup. - + class derives from the class and much of its functionality is provided by the and the base class for all markup text writers, which is the class. + +## Examples + The following code example demonstrates how to create a class named `CustomChtmlTextWriter` that is derived from the class. It creates two constructors and overrides the method to prevent the `bgcolor` style attribute from being written to the output stream of the object. It also creates a class named `ChtmlCustomPageAdapter` that defines one method, `CreateCustomChtmlTextWriter`, which creates and returns an instance of the `CustomChtmlTextWriter` class. The `CustomChtmlTextWriter` then renders cHTML content for a page to devices with browsers that use cHTML markup. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/cs/chtmltextwriter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet1"::: + ]]> @@ -86,27 +78,24 @@ The that renders the markup content. Initializes a new instance of the class that uses the constant to indent lines. - class has two constructors, which is standard for all classes that derive directly or indirectly from the class. - - The constructor, which takes an instance of the class as a parameter, calls the second constructor and passes it two parameter values: - -- The . - -- The string value that is specified in the field, which defines the tab spacing that is used by the XHTML text writer. - - - -## Examples - The following code example demonstrates how to create a class named `ChtmlCustomPageAdapter` and defines one method, `CreateCustomChtmlTextWriter`, which creates and returns an instance of the `CustomChtmlTextWriter` class. The `CustomChtmlTextWriter` then renders cHTML content for pages to devices with browsers that use cHTML markup. - - This code example is part of a larger example provided for the class. - + class has two constructors, which is standard for all classes that derive directly or indirectly from the class. + + The constructor, which takes an instance of the class as a parameter, calls the second constructor and passes it two parameter values: + +- The . +- The string value that is specified in the field, which defines the tab spacing that is used by the XHTML text writer. + +## Examples + The following code example demonstrates how to create a class named `ChtmlCustomPageAdapter` and defines one method, `CreateCustomChtmlTextWriter`, which creates and returns an instance of the `CustomChtmlTextWriter` class. The `CustomChtmlTextWriter` then renders cHTML content for pages to devices with browsers that use cHTML markup. + + This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/cs/chtmltextwriter.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet3"::: + ]]> @@ -133,19 +122,17 @@ The number of spaces defined in the . Initializes a new instance of the class with the specified line indentation. - constructor, which takes both an instance of the class and a string as parameters, calls the constructor that takes the same parameters when it creates an instance of the class. - - - -## Examples - The following code example demonstrates how to create a custom class named `CustomChtmlTextWriter` that is derived from the class. It creates two constructors that you can use to create an instance of the custom class with the same pattern as all classes that derive, directly or indirectly, from the class. - + constructor, which takes both an instance of the class and a string as parameters, calls the constructor that takes the same parameters when it creates an instance of the class. + +## Examples + The following code example demonstrates how to create a custom class named `CustomChtmlTextWriter` that is derived from the class. It creates two constructors that you can use to create an instance of the custom class with the same pattern as all classes that derive, directly or indirectly, from the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/cs/chtmltextwriter.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet1"::: + ]]> @@ -175,11 +162,11 @@ The attribute to add to . Adds an attribute to a cHTML element of the object. - method adds an attribute to a cHTML element. The recognized attribute is stored in the recognized attributes collection of the object that is referenced by the property. - + method adds an attribute to a cHTML element. The recognized attribute is stored in the recognized attributes collection of the object that is referenced by the property. + ]]> @@ -212,19 +199,22 @@ Gets a object of globally suppressed attributes that cannot be rendered on cHTML elements. A of globally suppressed cHTML attributes. - class is created. - -||| -|-|-| -|`onclick`|`onmousemove`| -|`ondblclick`|`onmouseout`| -|`onmousedown`|`onkeypress`| -|`onmouseup`|`onkeydown`| -|`onmouseover`|`onkeyup`| - + class is created. + +- `onclick` +- `onmousemove` +- `ondblclick` +- `onmouseout` +- `onmousedown` +- `onkeypress` +- `onmouseup` +- `onkeydown` +- `onmouseover` +- `onkeyup` + ]]> @@ -260,21 +250,21 @@ to write the attribute and its value to the output stream; otherwise, . - method prevents globally suppressed attributes that are listed in the property and element-specific, suppressed attributes that are listed in the property from being written to the output stream. You can override the behavior of the method in classes that are derived from the class. - - - -## Examples - The following code example demonstrates how to use a custom class that overrides the method to prevent the `bgcolor` attribute from being written to the cHTML output stream. It then calls the functionality that is provided by the base method from the class to ensure that its default behavior is used, too. - - This code example is part of a larger example provided for the class. - + method prevents globally suppressed attributes that are listed in the property and element-specific, suppressed attributes that are listed in the property from being written to the output stream. You can override the behavior of the method in classes that are derived from the class. + + + +## Examples + The following code example demonstrates how to use a custom class that overrides the method to prevent the `bgcolor` attribute from being written to the cHTML output stream. It then calls the functionality that is provided by the base method from the class to ensure that its default behavior is used, too. + + This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/cs/chtmltextwriter.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample4/vb/chtmltextwriter.vb" id="Snippet2"::: + ]]> @@ -309,11 +299,11 @@ if the style can be rendered; otherwise, . - method returns `false` when `key` is equal to the field and the value is `"line-through"`. - + method returns `false` when `key` is equal to the field and the value is `"line-through"`. + ]]> @@ -347,11 +337,11 @@ if the specified cHTML markup element can be rendered; otherwise, . - method returns `false`. For all other tags, it returns `true`. - + method returns `false`. For all other tags, it returns `true`. + ]]> @@ -383,11 +373,11 @@ Gets a object of recognized attributes that could be rendered on cHTML elements. A of recognized cHTML attributes. - method to add recognized attributes to the recognized attributes collection. - + method to add recognized attributes to the recognized attributes collection. + ]]> @@ -426,11 +416,11 @@ The attribute to remove from . Removes an attribute of a cHTML element of the object. - method removes an attribute from a cHTML element. The recognized attribute is removed from the recognized attributes collection of the object that is referenced by the property. - + method removes an attribute from a cHTML element. The recognized attribute is removed from the recognized attributes collection of the object that is referenced by the property. + ]]> @@ -462,26 +452,26 @@ Gets a object of user-specified suppressed attributes that are not rendered on cHTML elements. A of suppressed cHTML attributes. - method to add attributes to the suppressed attributes collection. - - The following list shows the default suppressed attributes that are set for a `div` element when a new instance of the class is created. - -||| -|-|-| -|`accesskey`|`gridlines`| -|`cellspacing`|`rules`| -|`cellpadding`|| - - The following list shows the default suppressed attributes that are set for a `span` element when a new instance of the class is created. - -||| -|-|-| -|`cellspacing`|`gridlines`| -|`cellpadding`|`rules`| - + method to add attributes to the suppressed attributes collection. + + The following list shows the default suppressed attributes that are set for a `div` element when a new instance of the class is created. + +- `accesskey` +- `gridlines` +- `cellspacing` +- `rules` +- `cellpadding` + + The following list shows the default suppressed attributes that are set for a `span` element when a new instance of the class is created. + +- `cellspacing` +- `gridlines` +- `cellpadding` +- `rules` + ]]> @@ -509,45 +499,45 @@ Writes a element to the cHTML output stream. - method to insert a line break into a stream of cHTML. - - - -## Examples - This section contains two code examples. The first code example demonstrates how to create a cHTML class and custom properties. The second code example demonstrates how to use a custom class on a Web page. - - To use the custom `ChtmlSimplelabelAdapter` adapter, add the following code to either the appropriate machine-wide file in the subdirectory for the browser of the .NET Framework configuration directory or to a custom browser file in the App_Browsers directory under the Web application root. - -``` - - - -``` - - The following code example demonstrates how to create a cHTML adapter class named `ChtmlSimpleLabelAdapter` for a class named `SimpleLabel`. It creates a custom `Control` property that allows the `ChtmlSimpleLabelAdapter` class to access the members of the `SimpleLabel` class, and then overrides the method. In the override, the following things occur: - -- It creates a reference to a object, named `w`, which is derived from the object that is passed as the `writer` parameter for the method. - -- It creates a string and sets it equal to the `SimpleLabel.Text` value. - -- It calls the method to apply the styles that are defined by the property of the label to the cHTML output stream. - -- It writes the `Text` property value to the stream and closes the style block by calling the method. - -- It calls the method to render a `br` element to the output stream after the text and styles render. - + method to insert a line break into a stream of cHTML. + + + +## Examples + This section contains two code examples. The first code example demonstrates how to create a cHTML class and custom properties. The second code example demonstrates how to use a custom class on a Web page. + + To use the custom `ChtmlSimplelabelAdapter` adapter, add the following code to either the appropriate machine-wide file in the subdirectory for the browser of the .NET Framework configuration directory or to a custom browser file in the App_Browsers directory under the Web application root. + +``` + + + +``` + + The following code example demonstrates how to create a cHTML adapter class named `ChtmlSimpleLabelAdapter` for a class named `SimpleLabel`. It creates a custom `Control` property that allows the `ChtmlSimpleLabelAdapter` class to access the members of the `SimpleLabel` class, and then overrides the method. In the override, the following things occur: + +- It creates a reference to a object, named `w`, which is derived from the object that is passed as the `writer` parameter for the method. + +- It creates a string and sets it equal to the `SimpleLabel.Text` value. + +- It calls the method to apply the styles that are defined by the property of the label to the cHTML output stream. + +- It writes the `Text` property value to the stream and closes the style block by calling the method. + +- It calls the method to render a `br` element to the output stream after the text and styles render. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/cs/chtmltestlabel.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/VB/chtmltestlabel.vb" id="Snippet2"::: - - The following example demonstrates how to use the `SimpleLabel` class in a Web page. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/VB/chtmltestlabel.vb" id="Snippet2"::: + + The following example demonstrates how to use the `SimpleLabel` class in a Web page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/cs/chtmltestlabel.aspx" id="Snippet3"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/VB/chtmltestlabel.aspx" id="Snippet3"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ChtmlTextWriter_Sample1/VB/chtmltestlabel.aspx" id="Snippet3"::: + ]]> @@ -576,15 +566,15 @@ The text string to encode and write to the output stream. Encodes the specified text for the requesting device, and then writes it to the output stream. - method is `null` or has a length of zero, then nothing is written. - - Use the method when a string contains angle brackets (\< or >) or an ampersand (&) and you want to ensure that they are rendered correctly on the requesting device. - - The method uses the base class's method. - + method is `null` or has a length of zero, then nothing is written. + + Use the method when a string contains angle brackets (\< or >) or an ampersand (&) and you want to ensure that they are rendered correctly on the requesting device. + + The method uses the base class's method. + ]]> diff --git a/xml/System.Web.UI/ObjectStateFormatter.xml b/xml/System.Web.UI/ObjectStateFormatter.xml index bbc642260e3..8e061a59372 100644 --- a/xml/System.Web.UI/ObjectStateFormatter.xml +++ b/xml/System.Web.UI/ObjectStateFormatter.xml @@ -27,41 +27,53 @@ Serializes and deserializes object graphs that represent the state of an object. This class cannot be inherited. - class serializes and deserializes object state graphs in a compact format. - - is used by the class and classes that derive from it to serialize view state and control state. It is also used by the class to provide object state graph formatting for various parts of the ASP.NET infrastructure. - - The class is optimized to serialize and format many common .NET Framework reference types, as well as constants. The following table lists the types that are optimized. - -||||| -|-|-|-|-| -||||| -||||String []| -|||null (`Nothing`)|| -||||| -||||| -||||| - - Additionally, while conventional string types and string arrays are written to and from a serialized binary writer unaltered, some strings are optimized by creating internal string tables. Strings are optimized using these tables if the string has an associated object or if the string is actually an instance of the class. - - Other types not listed above are binary-serialized using a object if they implement the interface or are decorated with the attribute. The class is not optimized for any of these serializable types. - - If the class encounters a type that is not serializable, an exception is thrown. - - - -## Examples - The following code example demonstrates how a class that derives from the class accesses the property to retrieve an instance to serialize view state and control state to a stream. This code example is part of a larger example provided for the class. - + The class serializes and deserializes object state graphs in a compact format. + + is used by the class and classes that derive from it to serialize view state and control state. It is also used by the class to provide object state graph formatting for various parts of the ASP.NET infrastructure. + + The class is optimized to serialize and format many common .NET Framework reference types, as well as constants. The following types are optimized: + +- +- +- +- +- +- +- +- `String[]` +- +- +- `null` (`Nothing`) +- +- +- +- +- +- +- +- +- +- +- + + Additionally, while conventional string types and string arrays are written to and from a serialized binary writer unaltered, some strings are optimized by creating internal string tables. Strings are optimized using these tables if the string has an associated object or if the string is actually an instance of the class. + + Other types not listed above are binary-serialized using a object if they implement the interface or are decorated with the attribute. The class is not optimized for any of these serializable types. + + If the class encounters a type that is not serializable, an exception is thrown. + +## Examples + The following code example demonstrates how a class that derives from the class accesses the property to retrieve an instance to serialize view state and control state to a stream. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/CS/textfilepagestatepersister.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet3"::: + ]]> @@ -98,12 +110,12 @@ Deserializes an object state graph from serialized form. - @@ -134,19 +146,19 @@ Deserializes an object state graph from its binary-serialized form that is contained in the specified object. An object that represents a deserialized object state graph. - method can be deserialized with the method. The method is used to restore an object state graph stored in a , such as a . - -[!INCLUDE [untrusted-data-method-note](~/includes/untrusted-data-method-note.md)] - -## Examples - The following code example demonstrates how a class that derives from the class initializes the collection. In this example, the collection has been assigned to the field of a object, and serialized to a file using the class. When the method is called, the method is used to deserialize view state from the file, and the property is initialized. This code example is part of a larger example provided for the class. - + method can be deserialized with the method. The method is used to restore an object state graph stored in a , such as a . + +[!INCLUDE [untrusted-data-method-note](~/includes/untrusted-data-method-note.md)] + +## Examples + The following code example demonstrates how a class that derives from the class initializes the collection. In this example, the collection has been assigned to the field of a object, and serialized to a file using the class. When the method is called, the method is used to deserialize view state from the file, and the property is initialized. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/CS/textfilepagestatepersister.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet2"::: + ]]> The specified is . @@ -177,19 +189,19 @@ Deserializes an object state graph from its serialized base64-encoded string form. An object that represents a deserialized object state graph. - method can be deserialized with the method. The method is used to restore an object state graph stored in base64-encoded string form. - -[!INCLUDE [untrusted-data-method-note](~/includes/untrusted-data-method-note.md)] - -## Examples - The following code example demonstrates how to implement a method that deserializes a base64-encoded string and returns an collection of property settings. This code example relies on the property settings having been serialized with the class, as shown in the method. - + method can be deserialized with the method. The method is used to restore an object state graph stored in base64-encoded string form. + +[!INCLUDE [untrusted-data-method-note](~/includes/untrusted-data-method-note.md)] + +## Examples + The following code example demonstrates how to implement a method that deserializes a base64-encoded string and returns an collection of property settings. This code example relies on the property settings having been serialized with the class, as shown in the method. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/CS/objectstateformattertest.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/VB/objectstateformattertest.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/VB/objectstateformattertest.vb" id="Snippet2"::: + ]]> The specified is or has a of 0. @@ -230,19 +242,19 @@ Serializes an object state graph to a base64-encoded string. A base-64 encoded string that represents the serialized object state of the parameter. - method can be deserialized with the method. The method is used to serialize an object state graph to a base64-encoded string form. - - - -## Examples - The following code example demonstrates how to serialize the values of a set of control properties to a base64-encoded string using the method. The string can be deserialized at a later time with the method. - + method can be deserialized with the method. The method is used to serialize an object state graph to a base64-encoded string form. + + + +## Examples + The following code example demonstrates how to serialize the values of a set of control properties to a base64-encoded string using the method. The string can be deserialized at a later time with the method. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/CS/objectstateformattertest.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/VB/objectstateformattertest.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.ObjectStateFormatter_1/VB/objectstateformattertest.vb" id="Snippet1"::: + ]]> @@ -272,19 +284,19 @@ The object to serialize. Serializes an object state graph to the specified object. - method can be deserialized with the method. The method is used to serialize an object state graph to a binary object. - - - -## Examples - The following code example demonstrates how a class retrieves an instance to serialize view state and control state to a stream using the method. This code example is part of a larger example provided for the class. - + method can be deserialized with the method. The method is used to serialize an object state graph to a binary object. + + + +## Examples + The following code example demonstrates how a class retrieves an instance to serialize view state and control state to a stream using the method. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/CS/textfilepagestatepersister.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Samples.AspNet.Alexkr.TextFilePageStatePersister_1/VB/textfilepagestatepersister.vb" id="Snippet3"::: + ]]> The specified is . @@ -313,13 +325,13 @@ For a description of this member, see . The that performs type lookups during deserialization. - instance is cast to an interface. - + + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -347,13 +359,13 @@ For a description of this member, see . The used for serialization and deserialization. - instance is cast to an interface. - + + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -391,11 +403,11 @@ For a description of this member, see . The top object of the deserialized graph. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -434,11 +446,11 @@ The object, or root of the object graph, to serialize. All child objects of this root object are automatically serialized. For a description of this member, see . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -466,13 +478,13 @@ For a description of this member, see . The used by this formatter. - instance is cast to an interface. - + + This member is an explicit interface member implementation. It can be used only when the instance is cast to an interface. + ]]> @@ -510,11 +522,11 @@ For a description of this member, see . An object that represents the state of an ASP.NET server control. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -552,11 +564,11 @@ For a description of this member, see . A string that represents a Web server control's view state. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Workflow.Activities/WorkflowServiceAttributes.xml b/xml/System.Workflow.Activities/WorkflowServiceAttributes.xml index 461a2e4cfe3..098cca210a7 100644 --- a/xml/System.Workflow.Activities/WorkflowServiceAttributes.xml +++ b/xml/System.Workflow.Activities/WorkflowServiceAttributes.xml @@ -35,27 +35,26 @@ Builds the service behavior for the workflow service that it decorates. - [!NOTE] -> [!INCLUDE[DeprecatedContent](~/includes/deprecatedcontent-md.md)] - - The WorkflowServiceAttributes class is used to define service attributes for a activity. - - Some of the attributes have default values, as shown below. - -||| -|-|-| -|Attribute|Default Value| -|AddressFilterMode|Exact| -|IgnoreExtensionDataObject|False| -|IncludeExceptionDetailInFault|False| -|MaxItemsInObjectGraph|2147483647| -|UseSynchronizationContext|True| -|ValidateMustUnderstand|True| - +> [!INCLUDE[DeprecatedContent](~/includes/deprecatedcontent-md.md)] + + The WorkflowServiceAttributes class is used to define service attributes for a activity. + + Some of the attributes have default values, as shown below. + +| Attribute | Default value | +|-------------------------------|---------------| +| AddressFilterMode | Exact | +| IgnoreExtensionDataObject | False | +| IncludeExceptionDetailInFault | False | +| MaxItemsInObjectGraph | 2147483647 | +| UseSynchronizationContext | True | +| ValidateMustUnderstand | True | + ]]> @@ -76,19 +75,19 @@ Initializes a new instance of the class. - activity is created. - - - -## Examples - The following example demonstrates how to create a new instance of the class. - + activity is created. + + + +## Examples + The following example demonstrates how to create a new instance of the class. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowserviceattributes/cs/snippets.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet0"::: + ]]> @@ -119,19 +118,19 @@ Gets or sets the enumeration that is used by the dispatcher to route incoming messages to the correct endpoint. An enumeration value that is used by the dispatcher to route incoming messages to the correct endpoint. - @@ -162,19 +161,19 @@ Gets or sets the value used to locate the service element in an application configuration file. The value to locate in the configuration file. - @@ -206,19 +205,19 @@ if unknown serialization data is never sent; otherwise, . - @@ -250,19 +249,19 @@ if unhandled exceptions are to be returned as SOAP faults; otherwise, . - @@ -293,19 +292,19 @@ Gets or sets the maximum number of items allowed in a serialized object. The maximum number of items allowed in an object. - . - - - -## Examples - The following example demonstrates how to access the `MaxItemsInObjectGraph` property. - + . + + + +## Examples + The following example demonstrates how to access the `MaxItemsInObjectGraph` property. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowserviceattributes/cs/snippets.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet5"::: + ]]> @@ -336,19 +335,19 @@ Gets or sets the value of the name attribute in the service element in Web Services Description Language (WSDL). The value of the Name property. - ` element when exported. The default value is null. - - - -## Examples - The following example demonstrates how to access the `Name` property. - + ` element when exported. The default value is null. + + + +## Examples + The following example demonstrates how to access the `Name` property. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowserviceattributes/cs/snippets.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet6"::: + ]]> @@ -379,19 +378,19 @@ Gets or sets the value of the target namespace for the service in Web Services Description Language (WSDL). The value of the Namespace property. - ` element that contains the `` element when exported. The default value is null. - - - -## Examples - The following example demonstrates how to access the `Namespace` property. - + ` element that contains the `` element when exported. The default value is null. + + + +## Examples + The following example demonstrates how to access the `Namespace` property. + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/workflowserviceattributes/cs/snippets.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/workflowserviceattributes/vb/snippets.vb" id="Snippet7"::: + ]]> @@ -423,19 +422,19 @@ if all calls to the service must run on the thread specified by the ; otherwise, . - @@ -467,19 +466,19 @@ if the system is to perform SOAP header processing; otherwise , which indicates that the application performs this processing. - diff --git a/xml/System.Xml/XmlTextReader.xml b/xml/System.Xml/XmlTextReader.xml index 2aab7eb45d6..be0e3baefa1 100644 --- a/xml/System.Xml/XmlTextReader.xml +++ b/xml/System.Xml/XmlTextReader.xml @@ -1495,7 +1495,7 @@ XmlTextReader reader = new XmlTextReader(s); ## Remarks > [!NOTE] -> Starting with the .NET Framework 2.0, we recommend that you create instances by using the method to take advantage of new functionality. +> We recommend that you create instances by using the method to take advantage of newer functionality. Because uses the class, `XmlTextReader` also supports all encodings supported by that class. The exception to this is any encoding, such as UTF-7 or EBCDIC, that maps the ` is set to `Significant` or `All`, the "doc" element expands the character entity and returns the general entity as a node: -|Depth|Node type|Name|Value| -|-----------|---------------|----------|-----------| -|1|`Text`||A| -|1|`EntityReference`|num|| -|1|`SignificantWhitespace`||| +| Depth | Node type | Name | Value | +|-------|-------------------------|------|-------| +| 1 | `Text` | | A | +| 1 | `EntityReference` | num | | +| 1 | `SignificantWhitespace` | | | ]]> diff --git a/xml/System.Xml/XmlValidatingReader.xml b/xml/System.Xml/XmlValidatingReader.xml index fb557be618c..b4474c51243 100644 --- a/xml/System.Xml/XmlValidatingReader.xml +++ b/xml/System.Xml/XmlValidatingReader.xml @@ -70,20 +70,20 @@ - Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation. - + Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation. + This class is obsolete. Starting with the .NET Framework 2.0, we recommend that you use the class and the method to create a validating XML reader. - class and provides support for data validation. Use the property to have the reader validate by using schema files that are cached in an . The property specifies what type of validation the reader should perform. Setting the property to ValidationType.None creates a non-validating reader. - - throws an on XML parse errors. After an exception is thrown the state of the reader is not predictable. For example, the reported node type may be different than the actual node type of the current node. Use the property to check whether a reader is in error state. - + class and provides support for data validation. Use the property to have the reader validate by using schema files that are cached in an . The property specifies what type of validation the reader should perform. Setting the property to ValidationType.None creates a non-validating reader. + + throws an on XML parse errors. After an exception is thrown the state of the reader is not predictable. For example, the reported node type may be different than the actual node type of the current node. Use the property to check whether a reader is in error state. + > [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -140,40 +140,40 @@ The to read from while validating. The current implementation supports only . Initializes a new instance of the class that validates the content returned from the given . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - All nodes returned from the given `XmlReader` are also returned from this validating reader, so there is no information loss in the process. New nodes not returned from the underlying reader may be added by this reader (for example, default attributes and the children of an entity reference). Any properties set on the given `XmlTextReader` also apply to this validating reader. For example, if the supplied reader had WhitespaceHandling.None set, this validating reader also ignores white space. - - When external document type definitions (DTDs) or schemas are needed for validation, the property sets the object to use for resolving external resources. - - - -## Examples - The following example validates two documents. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + All nodes returned from the given `XmlReader` are also returned from this validating reader, so there is no information loss in the process. New nodes not returned from the underlying reader may be added by this reader (for example, default attributes and the children of an entity reference). Any properties set on the given `XmlTextReader` also apply to this validating reader. For example, if the supplied reader had WhitespaceHandling.None set, this validating reader also ignores white space. + + When external document type definitions (DTDs) or schemas are needed for validation, the property sets the object to use for resolving external resources. + + + +## Examples + The following example validates two documents. + [!code-cpp[XmlValidatingReader.Cctor#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.Cctor/CPP/valid_xsd2.cpp#1)] [!code-csharp[XmlValidatingReader.Cctor#1](~/snippets/csharp/System.Xml/XmlValidatingReader/.ctor/valid_xsd2.cs#1)] - [!code-vb[XmlValidatingReader.Cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.Cctor/VB/valid_xsd2.vb#1)] - - The sample uses the following input files: - - `notValidXSD.xml` - - [!code-xml[XmlValidatingReader.Cctor#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/notvalidxsd.xml#2)] - - `books.xsd` - - [!code-xml[XmlValidatingReader.Cctor#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/books.xsd#3)] - - `inlineXSD.xml` - - [!code-xml[XmlValidatingReader.Cctor#4](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/inlinexsd.xml#4)] - + [!code-vb[XmlValidatingReader.Cctor#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.Cctor/VB/valid_xsd2.vb#1)] + + The sample uses the following input files: + + `notValidXSD.xml` + + [!code-xml[XmlValidatingReader.Cctor#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/notvalidxsd.xml#2)] + + `books.xsd` + + [!code-xml[XmlValidatingReader.Cctor#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/books.xsd#3)] + + `inlineXSD.xml` + + [!code-xml[XmlValidatingReader.Cctor#4](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.Cctor/XML/inlinexsd.xml#4)] + ]]> The reader specified is not an . @@ -223,38 +223,38 @@ The in which the XML fragment is to be parsed. This includes the to use, encoding, namespace scope, current , and scope. Initializes a new instance of the class with the specified values. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This constructor parses the given string as a fragment of XML. If the XML fragment is an element or attribute, you can bypass the root level rules for well-formed XML documents. - - The following table lists valid values for `fragType` and how the reader parses each of the different node types. - -|XmlNodeType|Fragment May Contain| -|-----------------|--------------------------| -|Element|Any valid element content (for example, any combination of elements, comments, processing instructions, cdata, text, and entity references).| -|Attribute|The value of an attribute (the part inside the quotes).| -|Document|The contents of an entire XML document; this enforces document level rules.| - - The reader uses the following steps to determine the encoding of the stream: - -1. Checks the property to determine the encoding. - -2. If the `Encoding` property is `null`, the reader checks for a byte-order mark at the beginning of the stream. - -3. If the `Encoding` property is `null`, and no byte-order mark is found, the reader assumes the stream is encoded in UTF-8. - - If this reader will be validating using document type definition (DTD) (that is, is set to ValidationType.DTD or ValidationType.Auto), the `XmlParserContext` specified in the constructor must supply all the necessary DocumentType information. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This constructor parses the given string as a fragment of XML. If the XML fragment is an element or attribute, you can bypass the root level rules for well-formed XML documents. + + The following table lists valid values for `fragType` and how the reader parses each of the different node types. + +|XmlNodeType|Fragment May Contain| +|-----------------|--------------------------| +|Element|Any valid element content (for example, any combination of elements, comments, processing instructions, cdata, text, and entity references).| +|Attribute|The value of an attribute (the part inside the quotes).| +|Document|The contents of an entire XML document; this enforces document level rules.| + + The reader uses the following steps to determine the encoding of the stream: + +1. Checks the property to determine the encoding. + +2. If the `Encoding` property is `null`, the reader checks for a byte-order mark at the beginning of the stream. + +3. If the `Encoding` property is `null`, and no byte-order mark is found, the reader assumes the stream is encoded in UTF-8. + + If this reader will be validating using document type definition (DTD) (that is, is set to ValidationType.DTD or ValidationType.Auto), the `XmlParserContext` specified in the constructor must supply all the necessary DocumentType information. + > [!NOTE] -> It is not possible to validate a fragment by using a DTD. By definition a DTD requires an entire document to be loaded for validation. - - If this reader will be validating by using XML-Data Reduced (XDR) or XML Schema definition language (XSD) schemas, use the property to specify the that contains the schemas (that is, the `XmlParserContext` does not need to supply the DocumentType information). - +> It is not possible to validate a fragment by using a DTD. By definition a DTD requires an entire document to be loaded for validation. + + If this reader will be validating by using XML-Data Reduced (XDR) or XML Schema definition language (XSD) schemas, use the property to specify the that contains the schemas (that is, the `XmlParserContext` does not need to supply the DocumentType information). + ]]> @@ -311,38 +311,38 @@ The in which the XML fragment is to be parsed. This includes the to use, encoding, namespace scope, current xml:lang, and xml:space scope. Initializes a new instance of the class with the specified values. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This constructor parses the given string as a fragment of XML. If the XML fragment is an element or attribute, you can bypass the root level rules for well-formed XML documents. This constructor can handle strings returned from . - - The following table lists valid values for `fragType` and how the reader parses each of the different node types. - -|XmlNodeType|Fragment May Contain| -|-----------------|--------------------------| -|Element|Any valid element content (for example, any combination of elements, comments, processing instructions, cdata, text, and entity references).| -|Attribute|The value of an attribute (the part inside the quotes).| -|Document|The contents of an entire XML document; this enforces document level rules.| - - If this reader will be validating by using document type definition (DTD) (that is, is set to ValidationType.DTD or ValidationType.Auto), the `XmlParserContext` specified in the constructor must supply all the necessary DocumentType information. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This constructor parses the given string as a fragment of XML. If the XML fragment is an element or attribute, you can bypass the root level rules for well-formed XML documents. This constructor can handle strings returned from . + + The following table lists valid values for `fragType` and how the reader parses each of the different node types. + +|XmlNodeType|Fragment May Contain| +|-----------------|--------------------------| +|Element|Any valid element content (for example, any combination of elements, comments, processing instructions, cdata, text, and entity references).| +|Attribute|The value of an attribute (the part inside the quotes).| +|Document|The contents of an entire XML document; this enforces document level rules.| + + If this reader will be validating by using document type definition (DTD) (that is, is set to ValidationType.DTD or ValidationType.Auto), the `XmlParserContext` specified in the constructor must supply all the necessary DocumentType information. + > [!NOTE] -> It is not possible to validate a fragment by using DTD. By definition DTD requires an entire document to be loaded for validation. - - If this reader will be validating by using XML-Data Reduced (XDR) or XML Schema definition language (XSD) schemas, use the property to specify the that contains the schemas (the `XmlParserContext` does not need to supply the DocumentType information). - - - -## Examples - The following example reads an XML fragment. It uses an `XmlParserContext` and its to handle namespace matching. - +> It is not possible to validate a fragment by using DTD. By definition DTD requires an entire document to be loaded for validation. + + If this reader will be validating by using XML-Data Reduced (XDR) or XML Schema definition language (XSD) schemas, use the property to specify the that contains the schemas (the `XmlParserContext` does not need to supply the DocumentType information). + + + +## Examples + The following example reads an XML fragment. It uses an `XmlParserContext` and its to handle namespace matching. + [!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)] - [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] + ]]> @@ -388,24 +388,24 @@ Gets the number of attributes on the current node. The number of attributes on the current node. This number includes default attributes. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property is relevant to `Element`, `DocumentType`, and `XmlDeclaration` nodes only. (Other node types do not have attributes.) - - - -## Examples - The following example reads all the elements on the root node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property is relevant to `Element`, `DocumentType`, and `XmlDeclaration` nodes only. (Other node types do not have attributes.) + + + +## Examples + The following example reads all the elements on the root node. + [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] + ]]> @@ -450,30 +450,30 @@ Gets the base URI of the current node. The base URI of the current node. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - A networked XML document is comprised of chunks of data aggregated by using various World Wide Web Consortium (W3C) standard inclusion mechanisms and therefore contains nodes that come from different places. document type definition (DTD) entities are an example of this, but this is not limited to DTDs. The base URI tells you where these nodes came from. If there is no base URI for the nodes being returned (for example, they were parsed from an in-memory string), String.Empty is returned. - - - -## Examples - The following example parses a file and displays the base URI of each node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + A networked XML document is comprised of chunks of data aggregated by using various World Wide Web Consortium (W3C) standard inclusion mechanisms and therefore contains nodes that come from different places. document type definition (DTD) entities are an example of this, but this is not limited to DTDs. The base URI tells you where these nodes came from. If there is no base URI for the nodes being returned (for example, they were parsed from an in-memory string), String.Empty is returned. + + + +## Examples + The following example parses a file and displays the base URI of each node. + [!code-cpp[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/BaseURI/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/VB/source.vb#1)] - - The example uses the file, `uri.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.BaseURI Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/XML/source.xml#2)] - - The `style.xml` file contains the XML text ``. - + [!code-vb[Classic WebData XmlValidatingReader.BaseURI Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/VB/source.vb#1)] + + The example uses the file, `uri.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.BaseURI Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.BaseURI Example/XML/source.xml#2)] + + The `style.xml` file contains the XML text ``. + ]]> @@ -517,15 +517,15 @@ if the binary content read methods are implemented; otherwise . The class returns . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The binary content read methods include the , , , and methods. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The binary content read methods include the , , , and methods. + ]]> @@ -570,13 +570,13 @@ if the reader can parse and resolve entities; otherwise, . always returns . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -620,17 +620,17 @@ Changes the to Closed. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method also releases any resources held while reading. If this reader was constructed by using an , this method also calls `Close` on the underlying reader. If this reader was constructed by using a stream, this method also calls `Close` on the underlying stream. - - If `Close` has already been called, no action is performed. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method also releases any resources held while reading. If this reader was constructed by using an , this method also calls `Close` on the underlying reader. If this reader was constructed by using a stream, this method also calls `Close` on the underlying stream. + + If `Close` has already been called, no action is performed. + ]]> @@ -674,22 +674,22 @@ Gets the depth of the current node in the XML document. The depth of the current node in the XML document. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example displays each node including its depth, line number, and line position. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example displays each node including its depth, line number, and line position. + [!code-cpp[IXmlLineInfo#1](~/snippets/cpp/VS_Snippets_Data/IXmlLineInfo/CPP/lineinfo.cpp#1)] [!code-csharp[IXmlLineInfo#1](~/snippets/csharp/System.Xml/IXmlLineInfo/Overview/lineinfo.cs#1)] - [!code-vb[IXmlLineInfo#1](~/snippets/visualbasic/VS_Snippets_Data/IXmlLineInfo/VB/lineinfo.vb#1)] - + [!code-vb[IXmlLineInfo#1](~/snippets/visualbasic/VS_Snippets_Data/IXmlLineInfo/VB/lineinfo.vb#1)] + ]]> @@ -741,17 +741,17 @@ Gets the encoding attribute for the document. The encoding value. If no encoding attribute exists, and there is not byte-order mark, this defaults to UTF-8. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - When any external reference is read (such as expanding an entity in a document type definition (DTD) file or reading a schema file) the encoding property is set to the encoding value of the external reference. If encoding is not specified in the external reference, and there is no byte-order mark, this defaults to UTF-8. - - All the encoding standards that the underlying operating system supports are supported. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + When any external reference is read (such as expanding an entity in a document type definition (DTD) file or reading a schema file) the encoding property is set to the encoding value of the external reference. If encoding is not specified in the external reference, and there is no byte-order mark, this defaults to UTF-8. + + All the encoding standards that the underlying operating system supports are supported. + ]]> @@ -795,51 +795,49 @@ Gets or sets a value that specifies how the reader handles entities. One of the values. If no is specified, it defaults to EntityHandling.ExpandEntities. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property can be changed and takes effect after the next call. - - When `EntityHandling` is set to `ExpandCharEntities`, attribute values are only partially normalized. The reader normalizes each individual text node independently from the content of adjacent entity reference nodes. - - To illustrate the difference between the entity handling modes consider the following XML: - -```xml -]> - A # -``` - - When `EntityHandling` is set to `ExpandEntities` the "doc" element node contains one text node with the expanded entity text: - -|Depth|NodeType|Name|Value| -|-----------|--------------|----------|-----------| -|1|Text||A 123| - - When `EntityHandling` is set to `ExpandCharEntities`, and is set to Significant or All, the "doc" element expands the character entity and returns the general entity as a node: - -|Depth|NodeType|Name|Value| -|-----------|--------------|----------|-----------| -|1|Text||A| -|1|EntityReference|num|| -|1|SignificantWhitespace||| - - - -## Examples - The following example uses the `ResolveEntity` method to expand a general entity. - - [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)] - [!code-csharp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/EntityHandling/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)] - - The example uses the file, `book1.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.ResolveEntity Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/XML/source.xml#2)] - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property can be changed and takes effect after the next call. + + When `EntityHandling` is set to `ExpandCharEntities`, attribute values are only partially normalized. The reader normalizes each individual text node independently from the content of adjacent entity reference nodes. + + To illustrate the difference between the entity handling modes consider the following XML: + +```xml +]> + A # +``` + + When `EntityHandling` is set to `ExpandEntities` the "doc" element node contains one text node with the expanded entity text: + +| Depth | NodeType | Name | Value | +|-------|----------|------|-------| +| 1 | Text | | A 123 | + + When `EntityHandling` is set to `ExpandCharEntities`, and is set to Significant or All, the "doc" element expands the character entity and returns the general entity as a node: + +| Depth | NodeType | Name | Value | +|-------|-----------------------|------|-------| +| 1 | Text | | A | +| 1 | EntityReference | num | | +| 1 | SignificantWhitespace | | | + +## Examples + The following example uses the `ResolveEntity` method to expand a general entity. + + [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/sour| [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)] | +|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|cs#1)] + [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)] + + The example uses the file, `book1.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.ResolveEntity Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/XML/source.xml#2)] + ]]> Invalid value was specified. @@ -885,13 +883,13 @@ if the reader is positioned at the end of the stream; otherwise, . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -949,14 +947,14 @@ Gets the value of the attribute with the specified index. The value of the specified attribute. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> The parameter is less than 0 or greater than or equal to . @@ -1006,30 +1004,30 @@ Gets the value of the attribute with the specified name. The value of the specified attribute. If the attribute is not found, is returned. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method does not move the reader. - - If the reader is positioned on a `DocumentType` node, this method can be used to get the PUBLIC and SYSTEM literals, for example, `reader.GetAttribute("PUBLIC")` - - - -## Examples - The following example gets the value of the ISBN attribute. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method does not move the reader. + + If the reader is positioned on a `DocumentType` node, this method can be used to get the PUBLIC and SYSTEM literals, for example, `reader.GetAttribute("PUBLIC")` + + + +## Examples + The following example gets the value of the ISBN attribute. + [!code-cpp[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/GetAttribute/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/VB/source.vb#1)] - - The example uses the file, `attrs.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.GetAttribute Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/XML/attrs.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.GetAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/VB/source.vb#1)] + + The example uses the file, `attrs.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.GetAttribute Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.GetAttribute Example/XML/attrs.xml#2)] + ]]> @@ -1087,35 +1085,35 @@ Gets the value of the attribute with the specified local name and namespace Uniform Resource Identifier (URI). The value of the specified attribute. If the attribute is not found, is returned. This method does not move the reader. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The following XML contains an attribute in a specific namespace: - -```xml - -``` - - You can look up the `dt:type` attribute by using one argument (prefix and local name) or two arguments (local name and namespace URI): - -```csharp -String dt = reader.GetAttribute("dt:type"); -String dt2 = reader.GetAttribute("type","urn:datatypes"); -``` - - To look up the `xmlns:dt` attribute, use one of the following arguments: - -```csharp -String dt3 = reader.GetAttribute("xmlns:dt"); -String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); -``` - - You can also get this information by using the property. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The following XML contains an attribute in a specific namespace: + +```xml + +``` + + You can look up the `dt:type` attribute by using one argument (prefix and local name) or two arguments (local name and namespace URI): + +```csharp +String dt = reader.GetAttribute("dt:type"); +String dt2 = reader.GetAttribute("type","urn:datatypes"); +``` + + To look up the `xmlns:dt` attribute, use one of the following arguments: + +```csharp +String dt3 = reader.GetAttribute("xmlns:dt"); +String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); +``` + + You can also get this information by using the property. + ]]> @@ -1163,13 +1161,13 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); if the class can return line information; otherwise, . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -1214,36 +1212,36 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); if the node on which the reader is currently positioned can have a ; otherwise, . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The following table lists node types that have a value to return. - -|Node Type|Value| -|---------------|-----------| -|`Attribute`|The value of the attribute.| -|`CDATA`|The content of the CDATA section.| -|`Comment`|The content of the comment.| -|`DocumentType`|The internal subset.| -|`ProcessingInstruction`|The entire content, excluding the target.| -|`SignificantWhitespace`|The white space between markup in a mixed content model.| -|`Text`|The content of the text node.| -|`Whitespace`|The white space between markup.| -|`XmlDeclaration`|The content of the declaration.| - - - -## Examples - The following example reads in XML with various data types and displays each of the nodes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The following table lists node types that have a value to return. + +|Node Type|Value| +|---------------|-----------| +|`Attribute`|The value of the attribute.| +|`CDATA`|The content of the CDATA section.| +|`Comment`|The content of the comment.| +|`DocumentType`|The internal subset.| +|`ProcessingInstruction`|The entire content, excluding the target.| +|`SignificantWhitespace`|The white space between markup in a mixed content model.| +|`Text`|The content of the text node.| +|`Whitespace`|The white space between markup.| +|`XmlDeclaration`|The content of the declaration.| + + + +## Examples + The following example reads in XML with various data types and displays each of the nodes. + [!code-cpp[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/HasValue/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.HasValue Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.HasValue Example/VB/source.vb#1)] + ]]> @@ -1288,33 +1286,33 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; if the attribute value was explicitly set. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example displays all attributes nodes on the root element. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example displays all attributes nodes on the root element. + [!code-cpp[XmlValidatingReader.IsDefault#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.IsDefault/CPP/readdefattr.cpp#1)] [!code-csharp[XmlValidatingReader.IsDefault#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsDefault/readdefattr.cs#1)] - [!code-vb[XmlValidatingReader.IsDefault#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.IsDefault/VB/readdefattr.vb#1)] - - The example uses the following files as input. - - `book4.xml` - - [!code-xml[XmlValidatingReader.IsDefault#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.IsDefault/XML/book4.xml#2)] - - `book.dtd` - - [!code-xml[XmlValidatingReader.IsDefault#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.IsDefault/XML/book.dtd#3)] - + [!code-vb[XmlValidatingReader.IsDefault#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.IsDefault/VB/readdefattr.vb#1)] + + The example uses the following files as input. + + `book4.xml` + + [!code-xml[XmlValidatingReader.IsDefault#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.IsDefault/XML/book4.xml#2)] + + `book.dtd` + + [!code-xml[XmlValidatingReader.IsDefault#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.IsDefault/XML/book.dtd#3)] + ]]> @@ -1359,36 +1357,36 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); if the current node is an element ( equals ) that ends with />; otherwise, . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property enables you to determine the difference between the following: - - `` (`IsEmptyElement` is `true`). - - `` (`IsEmptyElement` is `false`, although element content is empty). - - A corresponding `EndElement` node is not generated for empty elements. - - If default content has been added to an element due to schema validation, `IsEmptyElement` still returns `true`. It has no bearing on whether or not the element has a default value. In other words, `IsEmptyElement` simply reports whether or not the element in the source document had an end element tag. - - - -## Examples - The following example displays the text content of each element. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property enables you to determine the difference between the following: + + `` (`IsEmptyElement` is `true`). + + `` (`IsEmptyElement` is `false`, although element content is empty). + + A corresponding `EndElement` node is not generated for empty elements. + + If default content has been added to an element due to schema validation, `IsEmptyElement` still returns `true`. It has no bearing on whether or not the element has a default value. In other words, `IsEmptyElement` simply reports whether or not the element in the source document had an end element tag. + + + +## Examples + The following example displays the text content of each element. + [!code-cpp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsEmptyElement/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)] - - The example uses the file, `elems.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.IsEmptyElement Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)] + + The example uses the file, `elems.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.IsEmptyElement Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/XML/source.xml#2)] + ]]> @@ -1454,14 +1452,14 @@ String dt4 = reader.GetAttribute("dt",http://www.w3.org/2000/xmlns/); Gets the value of the attribute with the specified name. The value of the specified attribute. If the attribute is not found, returns . - @@ -1539,15 +1537,15 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the current line number. The current line number. The starting value for this property is 1. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property is most commonly used for error reporting, but can be called at any time. The starting value for this property is 1. Combined with , a value of 1,1 indicates the start of the document. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property is most commonly used for error reporting, but can be called at any time. The starting value for this property is 1. Combined with , a value of 1,1 indicates the start of the document. + ]]> @@ -1593,27 +1591,27 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the current line position. The current line position. The starting value for this property is 1. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property is most commonly used for error reporting, but can be called at any time. The starting value for this property is `1`. - - The position indicated is the first character of text in the markup. - -```xml - - abc - -``` - - On the first line of the preceding XML text, a `LinePosition` of `2` corresponds to the character `r`; on the second line, a `LinePosition` of `5` corresponds to the character `t`; and on the third line, a `LinePosition` of `3` corresponds to the character `r`. - - Combined with , a value of `1,1` indicates the start of the document. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property is most commonly used for error reporting, but can be called at any time. The starting value for this property is `1`. + + The position indicated is the first character of text in the markup. + +```xml + + abc + +``` + + On the first line of the preceding XML text, a `LinePosition` of `2` corresponds to the character `r`; on the second line, a `LinePosition` of `5` corresponds to the character `t`; and on the third line, a `LinePosition` of `3` corresponds to the character `r`. + + Combined with , a value of `1,1` indicates the start of the document. + ]]> @@ -1655,25 +1653,25 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the local name of the current node. - The name of the current node with the prefix removed. For example, is for the element <bk:book>. - + The name of the current node with the prefix removed. For example, is for the element <bk:book>. + For node types that do not have a name (like , , and so on), this property returns String.Empty. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML fragment. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML fragment. + [!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)] - [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] + ]]> @@ -1722,23 +1720,23 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Resolves a namespace prefix in the current element's scope. The namespace URI to which the prefix maps or if no matching prefix is found. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - In the following XML string, if the reader is positioned on the `href` attribute, the prefix `a` is resolved by calling `reader.LookupNamespace("a", true)`. The returned string is `urn:456`. - -```xml - - - - - -``` - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + In the following XML string, if the reader is positioned on the `href` attribute, the prefix `a` is resolved by calling `reader.LookupNamespace("a", true)`. The returned string is `urn:456`. + +```xml + + + + + +``` + ]]> @@ -1795,23 +1793,23 @@ If the reader is positioned on a `DocumentType` node, this method can be used to The index of the attribute. Moves to the attribute with the specified index. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads all the elements on the root node. - - [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)] - [!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] - - ]]> +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads all the elements on the root node. + + [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)] + [!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)] + [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] + + ]]> The parameter is less than 0 or greater than or equal to . @@ -1860,24 +1858,24 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if the attribute is found; otherwise, . If , the position of the reader does not change. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - After calling this method, the , , and properties reflect the properties of that attribute. - - - -## Examples - The following example reads an attribute with text and entity reference nodes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + After calling this method, the , , and properties reflect the properties of that attribute. + + + +## Examples + The following example reads an attribute with text and entity reference nodes. + [!code-cpp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToAttribute/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)] + ]]> @@ -1936,15 +1934,15 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if the attribute is found; otherwise, . If , the position of the reader does not change. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - After calling this method, the , , and properties reflect the properties of that attribute. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + After calling this method, the , , and properties reflect the properties of that attribute. + ]]> @@ -1990,24 +1988,24 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); if the reader is not positioned on an attribute (the position of the reader does not change). - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - Use this method to return to an element after navigating through its attributes. This method moves the reader to one of the following node types: `Element`, `DocumentType`, or `XmlDeclaration`. - - - -## Examples - The following example reads all the elements on the root node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + Use this method to return to an element after navigating through its attributes. This method moves the reader to one of the following node types: `Element`, `DocumentType`, or `XmlDeclaration`. + + + +## Examples + The following example reads all the elements on the root node. + [!code-cpp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/AttributeCount/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.AttributeCount Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.AttributeCount Example/VB/source.vb#1)] + ]]> @@ -2053,22 +2051,22 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if an attribute exists (the reader moves to the first attribute); otherwise, (the position of the reader does not change). - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML fragment. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML fragment. + [!code-cpp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToFirstAttribute/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)] + ]]> @@ -2114,24 +2112,24 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if there is a next attribute; if there are no more attributes. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - If the current node is an element node, this method is equivalent to . If `MoveToNextAttribute` returns `true`, the reader moves to the next attribute; otherwise, the position of the reader does not change. - - - -## Examples - The following example reads an XML fragment. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + If the current node is an element node, this method is equivalent to . If `MoveToNextAttribute` returns `true`, the reader moves to the next attribute; otherwise, the position of the reader does not change. + + + +## Examples + The following example reads an XML fragment. + [!code-cpp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToFirstAttribute/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.MoveToFirstAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToFirstAttribute Example/VB/source.vb#1)] + ]]> @@ -2173,48 +2171,48 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the qualified name of the current node. - The qualified name of the current node. For example, is for the element <bk:book>. - - The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string. - - Node Type - - Name - - The name of the attribute. - - The document type name. - - The tag name. - - The name of the entity referenced. - - The target of the processing instruction. - - The literal string . - + The qualified name of the current node. For example, is for the element <bk:book>. + + The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string. + + Node Type + + Name + + The name of the attribute. + + The document type name. + + The tag name. + + The name of the entity referenced. + + The target of the processing instruction. + + The literal string . + - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML file and displays each of the nodes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML file and displays each of the nodes. + [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] - - The example uses the file, `items.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] + + The example uses the file, `items.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] + ]]> @@ -2259,13 +2257,13 @@ If the reader is positioned on a `DocumentType` node, this method can be used to to do namespace support; otherwise, . The default is . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -2309,22 +2307,22 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the namespace Uniform Resource Identifier (URI) (as defined in the World Wide Web Consortium (W3C) Namespace specification) of the node on which the reader is positioned. The namespace URI of the current node; otherwise an empty string. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML fragment. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML fragment. + [!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)] - [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] + ]]> @@ -2369,15 +2367,15 @@ If the reader is positioned on a `DocumentType` node, this method can be used to that enables you to get the atomized version of a string within the node. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - All node and attribute names returned from are atomized by using the `NameTable`. When the same name is returned multiple times (for example, `Customer`), the same `String` object will be returned for that name. This makes it possible for you to write efficient code that does object comparisons on these strings instead of expensive string comparisons. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + All node and attribute names returned from are atomized by using the `NameTable`. When the same name is returned multiple times (for example, `Customer`), the same `String` object will be returned for that name. This makes it possible for you to write efficient code that does object comparisons on these strings instead of expensive string comparisons. + ]]> @@ -2422,28 +2420,28 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the type of the current node. One of the values representing the type of the current node. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property never returns the following `XmlNodeType` types: `Document`, `DocumentFragment`, `Entity`, or `Notation`. - - - -## Examples - The following example reads an XML file and displays each of the nodes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property never returns the following `XmlNodeType` types: `Document`, `DocumentFragment`, `Entity`, or `Notation`. + + + +## Examples + The following example reads an XML file and displays each of the nodes. + [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] - - The example uses the file, `items.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] + + The example uses the file, `items.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] + ]]> @@ -2487,21 +2485,21 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the namespace prefix associated with the current node. The namespace prefix associated with the current node. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML fragment. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML fragment. + [!code-csharp[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/csharp/System.Xml/XmlParserContext/.ctor/source.cs#1)] - [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlParserContext.XmlParserContext Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlParserContext.XmlParserContext Example/VB/source.vb#1)] + ]]> @@ -2545,14 +2543,14 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Gets the quotation mark character used to enclose the value of an attribute node. The quotation mark character (" or ') used to enclose the value of an attribute node. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -2598,28 +2596,28 @@ If the reader is positioned on a `DocumentType` node, this method can be used to if the next node was read successfully; if there are no more nodes to read. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - When a reader is first created and initialized, there is no information available. You must call `Read` to read the first node. - - - -## Examples - The following example reads an XML file and displays each node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + When a reader is first created and initialized, there is no information available. You must call `Read` to read the first node. + + + +## Examples + The following example reads an XML file and displays each node. + [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] - - The example uses the file, `items.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] + + The example uses the file, `items.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] + ]]> @@ -2663,57 +2661,57 @@ If the reader is positioned on a `DocumentType` node, this method can be used to Parses the attribute value into one or more , , or nodes. - if there are nodes to return. - - if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. - + if there are nodes to return. + + if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. + An empty attribute, such as, misc="", returns with a single node with a value of String.Empty. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - Use this method after calling to read through the text or entity reference nodes that make up the attribute value. The of the attribute value nodes is one plus the depth of the attribute node. The `Depth` increments and decrements by one when you step into and out of general entity references. - - For example, suppose you have the following XML: `` - - where the entity `b` is defined in the document type definition (DTD) as follows: `` - - If is set to `ExpandCharEntities`, the following C# code returns the attribute value as two text nodes and one entity reference node: - -```csharp -reader.MoveToAttribute("name"); - while (reader.ReadAttributeValue()) - { - if (reader.NodeType == XmlNodeType.Text) - { - // at this point reader.Value == "a " or " c" - } - else if (reader.NodeType == XmlNodeType.EntityReference) - { - // at this point reader.Name == "b" - reader.ResolveEntity(); - while (reader.ReadAttributeValue() && - reader.NodeType != XmlNodeType.EndEntity) - { - // reader.Value == "123" - } - } - } -``` - - - -## Examples - The following example reads an attribute with text and entity reference nodes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + Use this method after calling to read through the text or entity reference nodes that make up the attribute value. The of the attribute value nodes is one plus the depth of the attribute node. The `Depth` increments and decrements by one when you step into and out of general entity references. + + For example, suppose you have the following XML: `` + + where the entity `b` is defined in the document type definition (DTD) as follows: `` + + If is set to `ExpandCharEntities`, the following C# code returns the attribute value as two text nodes and one entity reference node: + +```csharp +reader.MoveToAttribute("name"); + while (reader.ReadAttributeValue()) + { + if (reader.NodeType == XmlNodeType.Text) + { + // at this point reader.Value == "a " or " c" + } + else if (reader.NodeType == XmlNodeType.EntityReference) + { + // at this point reader.Name == "b" + reader.ResolveEntity(); + while (reader.ReadAttributeValue() && + reader.NodeType != XmlNodeType.EndEntity) + { + // reader.Value == "123" + } + } + } +``` + + + +## Examples + The following example reads an attribute with text and entity reference nodes. + [!code-cpp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/MoveToAttribute/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)] - + [!code-vb[Classic WebData XmlValidatingReader.MoveToAttribute Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.MoveToAttribute Example/VB/source.vb#1)] + ]]> @@ -2764,26 +2762,26 @@ reader.MoveToAttribute("name"); Reads the content and returns the Base64 decoded binary bytes. The number of bytes written to the buffer. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method streams the content, decodes the Base64 content, and returns the decoded binary bytes (for example, an inline Base64 encoded GIF image) into the buffer. This method can be called successively to read large streams of embedded text. For more information, see RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies". You can obtain RFCs from the [Request for Comments Web site](https://www.rfc-editor.org). - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method streams the content, decodes the Base64 content, and returns the decoded binary bytes (for example, an inline Base64 encoded GIF image) into the buffer. This method can be called successively to read large streams of embedded text. For more information, see RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies". You can obtain RFCs from the [Request for Comments Web site](https://www.rfc-editor.org). + > [!NOTE] -> You should not access any of the reader properties between calls to the method until the method returns the value 0. - - This method has the following behavior: - -- returns the value 0 when it has reached the end of the byte stream it was operating on. The reader is positioned on the first non-content node. - -- If you ask for fewer, or the exact number, of bytes than are left in the stream, the reader remains in its current position. - -- is not supported on the following XML node types: Element, XmlDeclaration, None, Document, DocumentType, Notation, Entity, and DocumentFragment. - +> You should not access any of the reader properties between calls to the method until the method returns the value 0. + + This method has the following behavior: + +- returns the value 0 when it has reached the end of the byte stream it was operating on. The reader is positioned on the first non-content node. + +- If you ask for fewer, or the exact number, of bytes than are left in the stream, the reader remains in its current position. + +- is not supported on the following XML node types: Element, XmlDeclaration, None, Document, DocumentType, Notation, Entity, and DocumentFragment. + ]]> The value is . @@ -2840,26 +2838,26 @@ reader.MoveToAttribute("name"); Reads the content and returns the BinHex decoded binary bytes. The number of bytes written to the buffer. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method streams the content, decodes the BinHex content, and returns the decoded binary bytes (for example, an inline BinHex encoded GIF image) into the buffer. This method can be called successively to read large streams of embedded text. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method streams the content, decodes the BinHex content, and returns the decoded binary bytes (for example, an inline BinHex encoded GIF image) into the buffer. This method can be called successively to read large streams of embedded text. + > [!NOTE] -> You should not access any of the reader properties between calls to the method until the method returns the value 0. - - This method has the following behavior: - -- returns the value 0 when it has reached the end of the byte stream it was operating on. The reader is positioned on the first non-content node. - -- If you ask for fewer, or the exact number, of bytes than are left in the stream, the reader remains in its current position. - -- is not supported on the following XML node types: Element, XmlDeclaration, None, Document, DocumentType, Notation, Entity, and DocumentFragment. - +> You should not access any of the reader properties between calls to the method until the method returns the value 0. + + This method has the following behavior: + +- returns the value 0 when it has reached the end of the byte stream it was operating on. The reader is positioned on the first non-content node. + +- If you ask for fewer, or the exact number, of bytes than are left in the stream, the reader remains in its current position. + +- is not supported on the following XML node types: Element, XmlDeclaration, None, Document, DocumentType, Notation, Entity, and DocumentFragment. + ]]> The value is . @@ -2917,23 +2915,23 @@ reader.MoveToAttribute("name"); Reads the element and decodes the Base64 content. The number of bytes written to the buffer. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method reads the element content, decodes it using Base64 encoding, and returns the decoded binary bytes (for example, an inline Base64 encoded GIF image) into the buffer. For more information, see RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies". You can obtain RFCs from the [Request for Comments Web site](https://www.rfc-editor.org). - - This method can read only simple-content elements. The element can contain text, white space, significant white space, CDATA sections, comments, and processing instructions. It can also contain entity references, which are automatically expanded. The element cannot have child elements. - - This method is very similar to the method except that it can be called only on element node types. - - If the `count` value is higher than the number of bytes in the document, or if it is equal to the number of bytes in the document, the reads all the remaining bytes in the document and returns the number of bytes read. The next method call returns a zero and moves the reader to the node following the . - - If you call before all of the element content is consumed, the reader may behave as if the first content was consumed and then the method was called. This means that the reader will read all the text until the end element is encountered. It will then read the end tag node, read the next node, and then position itself on the next subsequent node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method reads the element content, decodes it using Base64 encoding, and returns the decoded binary bytes (for example, an inline Base64 encoded GIF image) into the buffer. For more information, see RFC 1521, "MIME (Multipurpose Internet Mail Extensions) Part One: Mechanisms for Specifying and Describing the Format of Internet Message Bodies". You can obtain RFCs from the [Request for Comments Web site](https://www.rfc-editor.org). + + This method can read only simple-content elements. The element can contain text, white space, significant white space, CDATA sections, comments, and processing instructions. It can also contain entity references, which are automatically expanded. The element cannot have child elements. + + This method is very similar to the method except that it can be called only on element node types. + + If the `count` value is higher than the number of bytes in the document, or if it is equal to the number of bytes in the document, the reads all the remaining bytes in the document and returns the number of bytes read. The next method call returns a zero and moves the reader to the node following the . + + If you call before all of the element content is consumed, the reader may behave as if the first content was consumed and then the method was called. This means that the reader will read all the text until the end element is encountered. It will then read the end tag node, read the next node, and then position itself on the next subsequent node. + ]]> The value is . @@ -2991,23 +2989,23 @@ reader.MoveToAttribute("name"); Reads the element and decodes the BinHex content. The number of bytes written to the buffer. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This method reads the element content, decodes it using BinHex encoding, and returns the decoded binary bytes (for example, an inline BinHex encoded GIF image) into the buffer. - - This method can read only simple-content elements. The element can contain text, white space, significant white space, CDATA sections, comments, and processing instructions. It can also contain entity references, which are automatically expanded. The element cannot have child elements. - - This method is very similar to the method except that it can be called only on element node types. - - If the `count` value is higher than the number of bytes in the document, or if it is equal to the number of bytes in the document, the reads all the remaining bytes in the document and returns the number of bytes read. The next method call returns a zero and moves the reader to the node following the . - - If you call before all of the element content is consumed, the reader may behave as if the first content was consumed and then the method was called. This means that the reader will read all the text until the end element is encountered. It will then read the end tag node, read the next node, and then position itself on the next subsequent node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This method reads the element content, decodes it using BinHex encoding, and returns the decoded binary bytes (for example, an inline BinHex encoded GIF image) into the buffer. + + This method can read only simple-content elements. The element can contain text, white space, significant white space, CDATA sections, comments, and processing instructions. It can also contain entity references, which are automatically expanded. The element cannot have child elements. + + This method is very similar to the method except that it can be called only on element node types. + + If the `count` value is higher than the number of bytes in the document, or if it is equal to the number of bytes in the document, the reads all the remaining bytes in the document and returns the number of bytes read. The next method call returns a zero and moves the reader to the node following the . + + If you call before all of the element content is consumed, the reader may behave as if the first content was consumed and then the method was called. This means that the reader will read all the text until the end element is encountered. It will then read the end tag node, read the next node, and then position itself on the next subsequent node. + ]]> The value is . @@ -3058,17 +3056,17 @@ reader.MoveToAttribute("name"); Gets the used to construct this . The specified in the constructor. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property allows the user to access properties specific to the supplied reader. It returns a typed `XmlReader`. The user should query for the type before casting. - - Changing the state of the returned reader (for example, calling one of the read methods) can lead to unpredictable results. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property allows the user to access properties specific to the supplied reader. It returns a typed `XmlReader`. The user should query for the type before casting. + + Changing the state of the returned reader (for example, calling one of the read methods) can lead to unpredictable results. + ]]> @@ -3112,13 +3110,13 @@ reader.MoveToAttribute("name"); Gets the state of the reader. One of the values. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> @@ -3163,39 +3161,39 @@ reader.MoveToAttribute("name"); Reads the contents of an element or text node as a string. The contents of the element or text node. This can be an empty string if the reader is positioned on something other than an element or text node, or if there is no more text content to return in the current context. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - If positioned on an element, `ReadString` concatenates all text, significant white space, white space, and CDATA section node types together and returns the concatenated data as the element content. The reader stops when any markup is encountered, including comments and processing instructions. This could occur in a mixed content model, or when an element end tag is read. - - If positioned on a text node, `ReadString` performs the same concatenation from the text node to the element end tag. If the reader is positioned on an attribute text node, `ReadString` has the same functionality as if the reader were position on the element start tag. It returns all the concatenated element text nodes. - - The property determines how `ReadString` works as follows: - -|Value|Description| -|-----------|-----------------| -|ExpandEntities|Returns expanded character and general entities. This is the default.| -|ExpandCharEntities|Returns the text content up to but not including a general entity reference. This means a general entity causes ReadString to stop. You must call `Read` to step over the entity reference.| - - - -## Examples - The following example displays the text content of each of the elements. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + If positioned on an element, `ReadString` concatenates all text, significant white space, white space, and CDATA section node types together and returns the concatenated data as the element content. The reader stops when any markup is encountered, including comments and processing instructions. This could occur in a mixed content model, or when an element end tag is read. + + If positioned on a text node, `ReadString` performs the same concatenation from the text node to the element end tag. If the reader is positioned on an attribute text node, `ReadString` has the same functionality as if the reader were position on the element start tag. It returns all the concatenated element text nodes. + + The property determines how `ReadString` works as follows: + +|Value|Description| +|-----------|-----------------| +|ExpandEntities|Returns expanded character and general entities. This is the default.| +|ExpandCharEntities|Returns the text content up to but not including a general entity reference. This means a general entity causes ReadString to stop. You must call `Read` to step over the entity reference.| + + + +## Examples + The following example displays the text content of each of the elements. + [!code-cpp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/IsEmptyElement/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)] - - The example uses the file, `elems.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.IsEmptyElement Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.IsEmptyElement Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/VB/source.vb#1)] + + The example uses the file, `elems.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.IsEmptyElement Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.IsEmptyElement Example/XML/source.xml#2)] + ]]> @@ -3241,42 +3239,42 @@ The text node can be either an element or an attribute text node. Gets the common language runtime type for the specified XML Schema definition language (XSD) type. The common language runtime type for the specified XML Schema type. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - For example, if the schema type is defined as `xsd:int`, the runtime type `int32` is returned for the object. This can be tested using the method and cast accordingly. The method always returns a type that is derived from the class. It never returns the type. - - If the reader is positioned on an attribute, this method returns the runtime typed object, but does not change the position of the reader. If the reader is positioned on an element, `ReadTypedValue` reads any CDATA, text, white space, significant white space, and comment nodes, returns the runtime typed object and positions the reader on the end tag. Any types that do not have a direct mapping, for example `NMTOKENS`, are returned as strings. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + For example, if the schema type is defined as `xsd:int`, the runtime type `int32` is returned for the object. This can be tested using the method and cast accordingly. The method always returns a type that is derived from the class. It never returns the type. + + If the reader is positioned on an attribute, this method returns the runtime typed object, but does not change the position of the reader. If the reader is positioned on an element, `ReadTypedValue` reads any CDATA, text, white space, significant white space, and comment nodes, returns the runtime typed object and positions the reader on the end tag. Any types that do not have a direct mapping, for example `NMTOKENS`, are returned as strings. + > [!NOTE] -> If has been set to ValidationType.None, data type information is not provided from either schemas or document type definitions (DTDs). - +> If has been set to ValidationType.None, data type information is not provided from either schemas or document type definitions (DTDs). + > [!CAUTION] -> After calling , `ReadTypedValue` will return `null`. - - - -## Examples - The following example displays the type information for each of the elements in the XML document. - +> After calling , `ReadTypedValue` will return `null`. + + + +## Examples + The following example displays the type information for each of the elements in the XML document. + [!code-cpp[XmlValidatingReader.SchemaType#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CPP/schematype.cpp#1)] [!code-csharp[XmlValidatingReader.SchemaType#1](~/snippets/csharp/System.Xml/XmlValidatingReader/ReadTypedValue/schematype.cs#1)] - [!code-vb[XmlValidatingReader.SchemaType#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.SchemaType/VB/schematype.vb#1)] - - The example uses the following input files. - - `booksSchema.xml` - - [!code-xml[XmlValidatingReader.SchemaType#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/booksschema.xml#2)] - - `books.xsd` - - [!code-xml[XmlValidatingReader.SchemaType#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/books.xsd#3)] - + [!code-vb[XmlValidatingReader.SchemaType#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.SchemaType/VB/schematype.vb#1)] + + The example uses the following input files. + + `booksSchema.xml` + + [!code-xml[XmlValidatingReader.SchemaType#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/booksschema.xml#2)] + + `books.xsd` + + [!code-xml[XmlValidatingReader.SchemaType#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/books.xsd#3)] + ]]> @@ -3320,31 +3318,31 @@ The text node can be either an element or an attribute text node. Resolves the entity reference for nodes. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - If the reader is positioned on an `EntityReference` node (`XmlNodeType.EntityReference`), if is called after calling this method, the entity replacement text is parsed. After the entity replacement text is finished, an `EndEntity` node is returned to close the entity reference scope. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + If the reader is positioned on an `EntityReference` node (`XmlNodeType.EntityReference`), if is called after calling this method, the entity replacement text is parsed. After the entity replacement text is finished, an `EndEntity` node is returned to close the entity reference scope. + > [!NOTE] -> After calling this method, if the entity is part of an attribute value, you must call to step into the entity. - - - -## Examples - The following example uses `ResolveEntity` to expand a general entity. - +> After calling this method, if the entity is part of an attribute value, you must call to step into the entity. + + + +## Examples + The following example uses `ResolveEntity` to expand a general entity. + [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/EntityHandling/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)] - - The example uses the file, `book1.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.ResolveEntity Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)] + + The example uses the file, `book1.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.ResolveEntity Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/XML/source.xml#2)] + ]]> The reader is not positioned on an node. @@ -3390,53 +3388,53 @@ The text node can be either an element or an attribute text node. Gets a to use for validation. The to use for validation. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The `XmlSchemaCollection` holds pre-loaded XML-Data Reduced (XDR) and XML Schema definition language (XSD) schemas. This property gives the reader access to the cache of schemas and allows it to validate without having to re-load schemas every time. The reader does not add anything to the `XmlSchemaCollection`. - - If the `XmlSchemaCollection` includes an XML schema (XSD) which contains `include` or `import` elements that reference other namespaces, the schemas for these other namespaces are loaded for validation purposes only. Unless these schemas were explicitly added to the schema collection, they will not be accessible using any of the collection methods or properties. For example, if the collection contains the schema file `a.xsd`, which contains a reference to the schema file `b.xsd`, you must add `b.xsd` to the schema collection before you can access it using any of the collection methods or properties. - - When the `XmlSchemaCollection` is accessed using the `Schemas` property, the method uses the specified by the property. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The `XmlSchemaCollection` holds pre-loaded XML-Data Reduced (XDR) and XML Schema definition language (XSD) schemas. This property gives the reader access to the cache of schemas and allows it to validate without having to re-load schemas every time. The reader does not add anything to the `XmlSchemaCollection`. + + If the `XmlSchemaCollection` includes an XML schema (XSD) which contains `include` or `import` elements that reference other namespaces, the schemas for these other namespaces are loaded for validation purposes only. Unless these schemas were explicitly added to the schema collection, they will not be accessible using any of the collection methods or properties. For example, if the collection contains the schema file `a.xsd`, which contains a reference to the schema file `b.xsd`, you must add `b.xsd` to the schema collection before you can access it using any of the collection methods or properties. + + When the `XmlSchemaCollection` is accessed using the `Schemas` property, the method uses the specified by the property. + > [!NOTE] -> The schemas must be added to the `XmlSchemaCollection` before the first `Read` call. - - - -## Examples - The following example validates three XML files using schemas stored in the XmlSchemaCollection. - +> The schemas must be added to the `XmlSchemaCollection` before the first `Read` call. + + + +## Examples + The following example validates three XML files using schemas stored in the XmlSchemaCollection. + [!code-cpp[Classic WebData XmlValidatingReader.Schemas Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.Schemas Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Schemas/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.Schemas Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/VB/source.vb#1)] - - The sample uses the following five input files: - - `booksSchema.xml` - - [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#2)] - - `booksSchemaFail.xml` - - [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#3)] - - `newbooks.xml` - - [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#4](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#4)] - - `books.xsd` - - [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#5](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#5)] - - `schema1.xdr` - - [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#6](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#6)] - + [!code-vb[Classic WebData XmlValidatingReader.Schemas Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/VB/source.vb#1)] + + The sample uses the following five input files: + + `booksSchema.xml` + + [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#2)] + + `booksSchemaFail.xml` + + [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#3)] + + `newbooks.xml` + + [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#4](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#4)] + + `books.xsd` + + [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#5](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#5)] + + `schema1.xdr` + + [!code-xml[Classic WebData XmlValidatingReader.Schemas Example#6](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Schemas Example/XML/source.xml#6)] + ]]> @@ -3488,63 +3486,63 @@ The text node can be either an element or an attribute text node. , , or depending whether the node value is a built in XML Schema definition language (XSD) type or a user defined simpleType or complexType; if the current node has no schema type. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The user needs to test for the returned type. For example, - -```csharp -object obj = vreader.SchemaType; - if (obj is XmlSchemaType) - { - XmlSchemaType st = (XmlSchemaType)obj; - // use XmlSchemaType object - } - if (obj is XmlSchemaDatatype) - { - XmlSchemaDatatype sd = (XmlSchemaDatatype)obj; - Type vt = sd.ValueType; - // use XmlSchemaDatatype object - } -``` - - If XML Schema validation is being performed, the `XmlSchemaType` or `XmlSchemaDatatype` corresponds to the current element being read. If document type definition (DTD validation) is being performed, this property returns `null`. - - `XmlSchemaDatatype` is returned if the current element, or attribute, is a simple type that can specify special validation constraints on the simple types, like min and max. - - `XmlSchemaSimpleType` is returned if the current element, or attribute, is a user defined simpleType. - - `XmlSchemaComplexType` is returned if the current element is a user defined complexType. This type cannot be returned by attributes. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The user needs to test for the returned type. For example, + +```csharp +object obj = vreader.SchemaType; + if (obj is XmlSchemaType) + { + XmlSchemaType st = (XmlSchemaType)obj; + // use XmlSchemaType object + } + if (obj is XmlSchemaDatatype) + { + XmlSchemaDatatype sd = (XmlSchemaDatatype)obj; + Type vt = sd.ValueType; + // use XmlSchemaDatatype object + } +``` + + If XML Schema validation is being performed, the `XmlSchemaType` or `XmlSchemaDatatype` corresponds to the current element being read. If document type definition (DTD validation) is being performed, this property returns `null`. + + `XmlSchemaDatatype` is returned if the current element, or attribute, is a simple type that can specify special validation constraints on the simple types, like min and max. + + `XmlSchemaSimpleType` is returned if the current element, or attribute, is a user defined simpleType. + + `XmlSchemaComplexType` is returned if the current element is a user defined complexType. This type cannot be returned by attributes. + > [!NOTE] -> If has been set to ValidationType.None, no data type information is provided from either schemas or DTDs. - +> If has been set to ValidationType.None, no data type information is provided from either schemas or DTDs. + > [!CAUTION] -> After calling , SchemaType will return Null. - - - -## Examples - The following example displays the type information for each of the elements in the XML document. - +> After calling , SchemaType will return Null. + + + +## Examples + The following example displays the type information for each of the elements in the XML document. + [!code-cpp[XmlValidatingReader.SchemaType#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.SchemaType/CPP/schematype.cpp#1)] [!code-csharp[XmlValidatingReader.SchemaType#1](~/snippets/csharp/System.Xml/XmlValidatingReader/ReadTypedValue/schematype.cs#1)] - [!code-vb[XmlValidatingReader.SchemaType#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.SchemaType/VB/schematype.vb#1)] - - The example uses the following input files. - - `booksSchema.xml` - - [!code-xml[XmlValidatingReader.SchemaType#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/booksschema.xml#2)] - - `books.xsd` - - [!code-xml[XmlValidatingReader.SchemaType#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/books.xsd#3)] - + [!code-vb[XmlValidatingReader.SchemaType#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.SchemaType/VB/schematype.vb#1)] + + The example uses the following input files. + + `booksSchema.xml` + + [!code-xml[XmlValidatingReader.SchemaType#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/booksschema.xml#2)] + + `books.xsd` + + [!code-xml[XmlValidatingReader.SchemaType#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.SchemaType/XML/books.xsd#3)] + ]]> @@ -3578,11 +3576,11 @@ object obj = vreader.SchemaType; [!NOTE] -> The class is obsolete in .NET Framework version 2.0. -> You can create a validating instance by using the class and the method. +> The class is obsolete in .NET Framework version 2.0. +> You can create a validating instance by using the class and the method. > For more information, see [Validating XML Data with XmlReader](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/hdf992b8(v=vs.100)). ]]> @@ -3665,11 +3663,11 @@ object obj = vreader.SchemaType; For a description of this member, see . An object that identifies the namespaces in scope. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3718,11 +3716,11 @@ object obj = vreader.SchemaType; For a description of this member, see . A string value that contains the namespace Uri that is associated with the prefix. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3772,11 +3770,11 @@ object obj = vreader.SchemaType; For a description of this member, see . A string value that contains the namespace prefix that is associated with the . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -3817,41 +3815,41 @@ object obj = vreader.SchemaType; Sets an event handler for receiving information about document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) schema validation errors. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - These events occur during and only if a of DTD, XDR, Schema, or Auto is specified. - - If no event handler is provided, an is thrown on the first validation error (Severity is equal to XmlSeverityType.Error). - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + These events occur during and only if a of DTD, XDR, Schema, or Auto is specified. + + If no event handler is provided, an is thrown on the first validation error (Severity is equal to XmlSeverityType.Error). + > [!NOTE] -> If an element reports a validation error, the rest of the content model for that element is not validated, however, its children are validated. The reader only reports the first error for a given element. - - The callback handler can use the property to guarantee that an XML instance document is validated against a schema. The `Severity` property allows you to distinguish between validation errors (Severity is equal to XmlSeverityType.Error) that indicate a fatal error, and validation warnings (Severity is equal to XmlSeverityType.Warning) that indicate that no schema information is available. - - - -## Examples - The following example validates a file against an XML Schema. - +> If an element reports a validation error, the rest of the content model for that element is not validated, however, its children are validated. The reader only reports the first error for a given element. + + The callback handler can use the property to guarantee that an XML instance document is validated against a schema. The `Severity` property allows you to distinguish between validation errors (Severity is equal to XmlSeverityType.Error) that indicate a fatal error, and validation warnings (Severity is equal to XmlSeverityType.Warning) that indicate that no schema information is available. + + + +## Examples + The following example validates a file against an XML Schema. + [!code-cpp[Classic WebData XmlValidatingReader.ValidationEventHandler Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.ValidationEventHandler Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/ValidationEventHandler/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.ValidationEventHandler Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/VB/source.vb#1)] - - The sample uses the following two input files: - - `notValidXSD.xml` (The `xsi:schemaLocation` attribute identifies the XML Schema for the reader.) - - [!code-xml[Classic WebData XmlValidatingReader.ValidationEventHandler Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/XML/source.xml#2)] - - `books.xsd` - - [!code-xml[Classic WebData XmlValidatingReader.ValidationEventHandler Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/XML/source.xml#3)] - + [!code-vb[Classic WebData XmlValidatingReader.ValidationEventHandler Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/VB/source.vb#1)] + + The sample uses the following two input files: + + `notValidXSD.xml` (The `xsi:schemaLocation` attribute identifies the XML Schema for the reader.) + + [!code-xml[Classic WebData XmlValidatingReader.ValidationEventHandler Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/XML/source.xml#2)] + + `books.xsd` + + [!code-xml[Classic WebData XmlValidatingReader.ValidationEventHandler Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationEventHandler Example/XML/source.xml#3)] + ]]> @@ -3896,44 +3894,44 @@ object obj = vreader.SchemaType; Gets or sets a value indicating the type of validation to perform. One of the values. If this property is not set, it defaults to ValidationType.Auto. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property must be set before the first call to . Setting this property to ValidationType.None creates a non-validating reader. - - If external document type definitions (DTDs) or schemas are needed for validation, the is used. - - - -## Examples - The following example validates two files. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property must be set before the first call to . Setting this property to ValidationType.None creates a non-validating reader. + + If external document type definitions (DTDs) or schemas are needed for validation, the is used. + + + +## Examples + The following example validates two files. + [!code-cpp[Classic WebData XmlValidatingReader.ValidationType Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.ValidationType Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/ValidationType/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.ValidationType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/VB/source.vb#1)] - - The sample uses the following four input files: - - `notValid.xml` (The "x-schema:" prefix identifies the XML-Data Reduced (XDR) schema for the reader.) - - [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#2)] - - `schema1.xdr` - - [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#3)] - - `cdDTD.xml` - - [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#4](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#4)] - - `book1.xml` - - [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#5](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#5)] - + [!code-vb[Classic WebData XmlValidatingReader.ValidationType Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/VB/source.vb#1)] + + The sample uses the following four input files: + + `notValid.xml` (The "x-schema:" prefix identifies the XML-Data Reduced (XDR) schema for the reader.) + + [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#2)] + + `schema1.xdr` + + [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#3](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#3)] + + `cdDTD.xml` + + [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#4](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#4)] + + `book1.xml` + + [!code-xml[Classic WebData XmlValidatingReader.ValidationType Example#5](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.ValidationType Example/XML/source.xml#5)] + ]]> Setting the property after a Read has been called. @@ -3976,52 +3974,52 @@ object obj = vreader.SchemaType; Gets the text value of the current node. - The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty. - - Node Type - - Value - - The value of the attribute. - - The content of the CDATA section. - - The content of the comment. - - The internal subset. - - The entire content, excluding the target. - - The white space between markup in a mixed content model. - - The content of the text node. - - The white space between markup. - - The content of the declaration. - + The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty. + + Node Type + + Value + + The value of the attribute. + + The content of the CDATA section. + + The content of the comment. + + The internal subset. + + The entire content, excluding the target. + + The white space between markup in a mixed content model. + + The content of the text node. + + The white space between markup. + + The content of the declaration. + - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - - -## Examples - The following example reads an XML file and displays each node. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + + +## Examples + The following example reads an XML file and displays each node. + [!code-cpp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/CPP/source.cpp#1)] [!code-csharp[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/Name/source.cs#1)] - [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] - - The example uses the file, `items.xml`, as input. - - [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] - + [!code-vb[Classic WebData XmlValidatingReader.Name Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/VB/source.vb#1)] + + The example uses the file, `items.xml`, as input. + + [!code-xml[Classic WebData XmlValidatingReader.Name Example#2](~/snippets/xml/VS_Snippets_Data/Classic WebData XmlValidatingReader.Name Example/XML/source.xml#2)] + ]]> @@ -4065,23 +4063,23 @@ object obj = vreader.SchemaType; Gets the current scope. The current scope. - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - This property represents the xml:lang scope within which the current node resides. For example, here is an XML fragment with `xml:lang` set to U.S. English in the root element: - -```xml - -Fred - -``` - - When the reader is positioned on the `name` element, you can use this property to find that it is in the scope of a U.S. English `xml:lang` attribute. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + This property represents the xml:lang scope within which the current node resides. For example, here is an XML fragment with `xml:lang` set to U.S. English in the root element: + +```xml + +Fred + +``` + + When the reader is positioned on the `name` element, you can use this property to find that it is in the scope of a U.S. English `xml:lang` attribute. + ]]> @@ -4123,48 +4121,48 @@ object obj = vreader.SchemaType; Sets the used for resolving external document type definition (DTD) and schema location references. The is also used to handle any import or include elements found in XML Schema definition language (XSD) schemas. - The to use. If set to , external resources are not resolved. - + The to use. If set to , external resources are not resolved. + In version 1.1 of the .NET Framework, the caller must be fully trusted to specify an . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - - The `XmlResolver` is used to load any DTDs, entities, or schemas needed to complete the validation process. - - This property can be set at any time and takes affect after the next call. If this property is set to `null`, the reader assumes the user is not interested in resolving external references. In this case, the reader only validates against internal resources, if the resource is present. - - In version 1.1 of .NET Framework , if this property is not set, the trust level of the application determines the default behavior. - - `Fully trusted code:` The reader uses a default with no user credentials. If authentication is required to access a network resource, use the `XmlResolver` property to specify an `XmlResolver` with the necessary credentials. - - `Semi-trusted code:` The `XmlResolver` property is set to `null`. External resources are not resolved. - - When validating using schemas, you can avoid the expensive load process by providing an using the property. - - - -## Examples - The following example uses the `XmlResolver` property to specify the credentials necessary to access the networked DTD file. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + + The `XmlResolver` is used to load any DTDs, entities, or schemas needed to complete the validation process. + + This property can be set at any time and takes affect after the next call. If this property is set to `null`, the reader assumes the user is not interested in resolving external references. In this case, the reader only validates against internal resources, if the resource is present. + + In version 1.1 of .NET Framework , if this property is not set, the trust level of the application determines the default behavior. + + `Fully trusted code:` The reader uses a default with no user credentials. If authentication is required to access a network resource, use the `XmlResolver` property to specify an `XmlResolver` with the necessary credentials. + + `Semi-trusted code:` The `XmlResolver` property is set to `null`. External resources are not resolved. + + When validating using schemas, you can avoid the expensive load process by providing an using the property. + + + +## Examples + The following example uses the `XmlResolver` property to specify the credentials necessary to access the networked DTD file. + [!code-cpp[XmlValidatingReader.XmlResolver#1](~/snippets/cpp/VS_Snippets_Data/XmlValidatingReader.XmlResolver/CPP/vrdr_resolver.cpp#1)] [!code-csharp[XmlValidatingReader.XmlResolver#1](~/snippets/csharp/System.Xml/XmlValidatingReader/XmlResolver/vrdr_resolver.cs#1)] - [!code-vb[XmlValidatingReader.XmlResolver#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.XmlResolver/VB/vrdr_resolver.vb#1)] - - The example uses the following files as input. - - `book5.xml` - - [!code-xml[XmlValidatingReader.XmlResolver#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.XmlResolver/XML/book5.xml#2)] - - `books.dtd` - - [!code-xml[XmlValidatingReader.XmlResolver#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.XmlResolver/XML/books.dtd#3)] - + [!code-vb[XmlValidatingReader.XmlResolver#1](~/snippets/visualbasic/VS_Snippets_Data/XmlValidatingReader.XmlResolver/VB/vrdr_resolver.vb#1)] + + The example uses the following files as input. + + `book5.xml` + + [!code-xml[XmlValidatingReader.XmlResolver#2](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.XmlResolver/XML/book5.xml#2)] + + `books.dtd` + + [!code-xml[XmlValidatingReader.XmlResolver#3](~/snippets/xml/VS_Snippets_Data/XmlValidatingReader.XmlResolver/XML/books.dtd#3)] + ]]> @@ -4212,13 +4210,13 @@ object obj = vreader.SchemaType; Gets the current scope. One of the values. If no scope exists, this property defaults to . - [!NOTE] -> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. - +> The class is obsolete in .NET Framework 2.0. You can create a validating instance by using the class and the method. For more information, see the Remarks section of the reference page. + ]]> diff --git a/xml/System/BitConverter.xml b/xml/System/BitConverter.xml index fca608f71ce..c942c167864 100644 --- a/xml/System/BitConverter.xml +++ b/xml/System/BitConverter.xml @@ -65,11 +65,11 @@ Converts base data types to an array of bytes, and an array of bytes to base data types. - class helps manipulate value types in their fundamental form, as a series of bytes. A byte is defined as an 8-bit unsigned integer. The class includes static methods to convert each of the primitive types to and from an array of bytes, as the following table illustrates. - + class helps manipulate value types in their fundamental form, as a series of bytes. A byte is defined as an 8-bit unsigned integer. The class includes static methods to convert each of the primitive types to and from an array of bytes, as the following table illustrates. + | Type | To byte conversion | From byte conversion | |-----------------------|--------------------------------------------------------|-----------------------------------------| | | | | @@ -83,40 +83,40 @@ | | | | | | | | | | | | - + If you use methods to round-trip data, make sure that the overload and the `To`*Type* method specify the same type. As the following example illustrates, restoring an array that represents a signed integer by calling the method can result in a value that is different from the original. For more information, see [Working with Signed Non-Decimal and Bitwise Values](/archive/blogs/bclteam/working-with-signed-non-decimal-and-bitwise-values-ron-petrusha). - + :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/example1.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/example1.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.Class/VB/example1.vb" id="Snippet3"::: - - The order of bytes in the array returned by the method overloads (as well as the order of bits in the integer returned by the method) depends on whether the computer architecture is little-endian or big-endian. Similarly, the order of bytes in the array and returned by the `To`*IntegerValue* methods and the method depends on whether the computer architecture is little-endian or big-endian. The endianness of an architecture is indicated by the property, which returns `true` on little-endian systems and `false` on big-endian systems. On little-endian systems, lower-order bytes precede higher-order bytes. On big-endian system, higher-order bytes precede lower-order bytes. The following table illustrates the difference in the byte arrays that result from passing the integer 1,234,567,890 (0x499602D2) to the method. The bytes are listed in order from the byte at index 0 to the byte at index 3. - -||| -|-|-| -|Little-endian|D2-02-96-49| -|Big-endian|49-96-02-D2| - - Because the return value of some methods depends on system architecture, be careful when transmitting byte data beyond machine boundaries: - -- If all systems sending and receiving data are guaranteed to have the same endianness, nothing has to be done to the data. - -- If systems sending and receiving data can have different endianness, always transmit data in a particular order. This means that the order of bytes in the array may have to be reversed either before sending them or after receiving them. A common convention is to transmit data in network byte order (big-endian order). The following example provides an implementation for sending an integer value in network byte order. - + + The order of bytes in the array returned by the method overloads (as well as the order of bits in the integer returned by the method) depends on whether the computer architecture is little-endian or big-endian. Similarly, the order of bytes in the array and returned by the `To`*IntegerValue* methods and the method depends on whether the computer architecture is little-endian or big-endian. The endianness of an architecture is indicated by the property, which returns `true` on little-endian systems and `false` on big-endian systems. On little-endian systems, lower-order bytes precede higher-order bytes. On big-endian system, higher-order bytes precede lower-order bytes. The following table illustrates the difference in the byte arrays that result from passing the integer 1,234,567,890 (0x499602D2) to the method. The bytes are listed in order from the byte at index 0 to the byte at index 3. + +| Architecture | Byte array | +|---------------|-------------| +| Little-endian | D2-02-96-49 | +| Big-endian | 49-96-02-D2 | + + Because the return value of some methods depends on system architecture, be careful when transmitting byte data beyond machine boundaries: + +- If all systems sending and receiving data are guaranteed to have the same endianness, nothing has to be done to the data. + +- If systems sending and receiving data can have different endianness, always transmit data in a particular order. This means that the order of bytes in the array may have to be reversed either before sending them or after receiving them. A common convention is to transmit data in network byte order (big-endian order). The following example provides an implementation for sending an integer value in network byte order. + :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/networkorder1.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/networkorder1.fs" id="Snippet4"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.Class/VB/networkorder1.vb" id="Snippet4"::: - + - If systems sending and receiving data can have different endianness and the data to be transmitted consists of signed integers, call the method to convert the data to network byte order and the method to convert it to the order required by the recipient. - -## Examples - The following code example illustrates the use of several class methods. - + +## Examples + The following code example illustrates the use of several class methods. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.Class/CPP/bitconv.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/bitconv.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/bitconv.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.Class/VB/bitconv.vb" id="Snippet1"::: - + ]]> @@ -176,14 +176,14 @@ Converts the specified double-precision floating point number to a 64-bit signed integer. A 64-bit signed integer whose value is equivalent to . - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of several values to values with the `DoubleToInt64Bits` method. - + +## Examples + The following code example converts the bit patterns of several values to values with the `DoubleToInt64Bits` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CPP/dbltobits.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/DoubleToInt64Bits/dbltobits.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/FS/dbltobits.fs" id="Snippet2"::: @@ -297,18 +297,18 @@ Returns the specified Boolean value as a byte array. A byte array with length 1. - value by calling the method. - -## Examples - The following example converts the bit patterns of values to arrays with the `GetBytes` method. - - :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CPP/bytesbool.cpp" id="Snippet1"::: - :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesbool.cs" interactive="try-dotnet" id="Snippet1"::: - :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/FS/bytesbool.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/VB/bytesbool.vb" id="Snippet1"::: + +## Examples + The following example converts the bit patterns of values to arrays with the `GetBytes` method. + + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CPP/bytesbool.cpp" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesbool.cs" interactive="try-dotnet" id="Snippet1"::: + :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/FS/bytesbool.fs" id="Snippet1"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/VB/bytesbool.vb" id="Snippet1"::: ]]> @@ -363,14 +363,14 @@ Returns the specified Unicode character value as an array of bytes. An array of bytes with length 2. - method depends on whether the computer architecture is little-endian or big-endian. -## Examples - The following code example converts the bit patterns of values (Unicode characters) to arrays with the `GetBytes` method. - +## Examples + The following code example converts the bit patterns of values (Unicode characters) to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CPP/byteschar.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/byteschar.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/FS/byteschar.fs" id="Snippet2"::: @@ -435,14 +435,14 @@ Returns the specified double-precision floating-point value as an array of bytes. An array of bytes with length 8. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CPP/bytesdouble.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesdouble.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/FS/bytesdouble.fs" id="Snippet4"::: @@ -578,14 +578,14 @@ Returns the specified 16-bit signed integer value as an array of bytes. An array of bytes with length 2. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CPP/bytesint16.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesint16.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/FS/bytesint16.fs" id="Snippet3"::: @@ -650,14 +650,14 @@ Returns the specified 32-bit signed integer value as an array of bytes. An array of bytes with length 4. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CPP/bytesint32.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesint32.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/FS/bytesint32.fs" id="Snippet2"::: @@ -722,14 +722,14 @@ Returns the specified 64-bit signed integer value as an array of bytes. An array of bytes with length 8. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following example calls the method to convert each element in an array to a arrays. - + +## Examples + The following example calls the method to convert each element in an array to a arrays. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/CPP/bytesint64.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesint64.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.SInts/FS/bytesint64.fs" id="Snippet1"::: @@ -794,14 +794,14 @@ Returns the specified single-precision floating point value as an array of bytes. An array of bytes with length 4. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/CPP/bytessingle.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytessingle.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.Others/FS/bytessingle.fs" id="Snippet3"::: @@ -906,14 +906,14 @@ Returns the specified 16-bit unsigned integer value as an array of bytes. An array of bytes with length 2. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CPP/bytesuint16.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesuint16.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/FS/bytesuint16.fs" id="Snippet3"::: @@ -978,14 +978,14 @@ Returns the specified 32-bit unsigned integer value as an array of bytes. An array of bytes with length 4. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CPP/bytesuint32.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesuint32.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/FS/bytesuint32.fs" id="Snippet2"::: @@ -1050,14 +1050,14 @@ Returns the specified 64-bit unsigned integer value as an array of bytes. An array of bytes with length 8. - method depends on whether the computer architecture is little-endian or big-endian. - -## Examples - The following code example converts the bit patterns of values to arrays with the `GetBytes` method. - + +## Examples + The following code example converts the bit patterns of values to arrays with the `GetBytes` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/CPP/bytesuint64.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/GetBytes/bytesuint64.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.GetBytes.UInts/FS/bytesuint64.fs" id="Snippet1"::: @@ -1281,19 +1281,19 @@ Reinterprets the specified 64-bit signed integer to a double-precision floating point number. A double-precision floating point number whose value is equivalent to . - method. - -## Examples - The following code example converts the bit patterns of several values to values with the `Int64BitsToDouble` method. - + +## Examples + The following code example converts the bit patterns of several values to values with the `Int64BitsToDouble` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/CPP/bitstodbl.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/DoubleToInt64Bits/bitstodbl.cs" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/FS/bitstodbl.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/VB/bitstodbl.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.DoubleInt64/VB/bitstodbl.vb" id="Snippet1"::: + ]]> @@ -1342,17 +1342,17 @@ Indicates the byte order ("endianness") in which data is stored in this computer architecture. - [!NOTE] > You can convert from network byte order to the byte order of the host computer without retrieving the value of the field by passing a 16-bit, 32-bit, or 64 bit integer to the method. - -## Examples - The following code example illustrates the use of the `IsLittleEndian` field. - + +## Examples + The following code example illustrates the use of the `IsLittleEndian` field. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.Class/CPP/littleend.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/Overview/littleend.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.Class/FS/littleend.fs" id="Snippet2"::: @@ -1540,19 +1540,19 @@ if the byte at in is nonzero; otherwise, . - value to its byte representation, call the method. - -## Examples - The following code example converts elements of arrays to values with the `ToBoolean` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToBoolean` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batobool.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToBoolean/batobool.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/FS/batobool.fs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batobool.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batobool.vb" id="Snippet1"::: + ]]> @@ -1654,19 +1654,19 @@ Returns a Unicode character converted from two bytes at a specified position in a byte array. The character formed by two bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values (Unicode characters) with the `ToChar` method. - + +## Examples + The following code example converts elements of arrays to values (Unicode characters) with the `ToChar` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batochar.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToBoolean/batochar.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/FS/batochar.fs" id="Snippet2"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batochar.vb" id="Snippet2"::: - + ]]> @@ -1776,19 +1776,19 @@ Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array. A double-precision floating point number formed by eight bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToDouble` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToDouble` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batodouble.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToBoolean/batodouble.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/FS/batodouble.fs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/VB/batodouble.vb" id="Snippet3"::: - + ]]> @@ -2059,14 +2059,14 @@ Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. A 16-bit signed integer formed by two bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 1 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToInt16` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToInt16` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CPP/batoint16.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToInt16/batoint16.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/FS/batoint16.fs" id="Snippet1"::: @@ -2181,14 +2181,14 @@ Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. A 32-bit signed integer formed by four bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 3 to an value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . - -## Examples - The following example uses the method to create values from a four-byte array and from the upper four bytes of an eight-byte array. It also uses the and methods to round-trip an value. - + +## Examples + The following example uses the method to create values from a four-byte array and from the upper four bytes of an eight-byte array. It also uses the and methods to round-trip an value. + :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToInt32/toint32.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.bitconverter.toint32/fs/toint32.fs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.bitconverter.toint32/vb/toint32.vb" id="Snippet1"::: @@ -2302,14 +2302,14 @@ Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. A 64-bit signed integer formed by eight bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToInt64` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToInt64` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/CPP/batoint64.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToInt16/batoint64.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.SInts/FS/batoint64.fs" id="Snippet3"::: @@ -2424,14 +2424,14 @@ Returns a single-precision floating point number converted from four bytes at a specified position in a byte array. A single-precision floating point number formed by four bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of . - -## Examples - The following code example converts elements of arrays to values with the `ToSingle` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToSingle` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/CPP/batosingle.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToBoolean/batosingle.cs" interactive="try-dotnet" id="Snippet4"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.Others/FS/batosingle.fs" id="Snippet4"::: @@ -2508,14 +2508,14 @@ Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation. A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in ; for example, "7F-2C-4A-00". - arrays to objects with the `ToString` method. - + +## Examples + The following code example converts arrays to objects with the `ToString` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToString/CPP/batostring.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToString/batostring.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToString/FS/batostring.fs" id="Snippet1"::: @@ -2577,14 +2577,14 @@ Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of ; for example, "7F-2C-4A-00". - array starting at the specified `startIndex` to a with the `ToString` method. - + +## Examples + The following code example converts the part of a array starting at the specified `startIndex` to a with the `ToString` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToString/CPP/batostringii.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToString/batostringii.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToString/FS/batostringii.fs" id="Snippet2"::: @@ -2650,28 +2650,28 @@ Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of ; for example, "7F-2C-4A-00". - . - -## Examples - The following example uses the method to convert part of a byte array, starting at the specified `startIndex` and with the specified `length`, to a string. - + +## Examples + The following example uses the method to convert part of a byte array, starting at the specified `startIndex` and with the specified `length`, to a string. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToString/CPP/batostringii.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToString/batostringii.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToString/FS/batostringii.fs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToString/VB/batostringii.vb" id="Snippet2"::: + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.BitConverter.ToString/VB/batostringii.vb" id="Snippet2"::: ]]> is . - or is less than zero. - - -or- - + or is less than zero. + + -or- + is greater than zero and is greater than or equal to the length of . The combination of and does not specify a position within ; that is, the parameter is greater than the length of minus the parameter. @@ -2870,14 +2870,14 @@ Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. A 16-bit unsigned integer formed by two bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 1 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToUInt16` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToUInt16` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CPP/batouint16.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToUInt16/batouint16.cs" interactive="try-dotnet" id="Snippet1"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/FS/batouint16.fs" id="Snippet1"::: @@ -2998,14 +2998,14 @@ Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. A 32-bit unsigned integer formed by four bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 3 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToUInt32` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToUInt32` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CPP/batouint32.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToUInt16/batouint32.cs" interactive="try-dotnet" id="Snippet2"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/FS/batouint32.fs" id="Snippet2"::: @@ -3126,14 +3126,14 @@ Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. A 64-bit unsigned integer formed by the eight bytes beginning at . - method converts the bytes from index `startIndex` to `startIndex` + 7 to a value. The order of bytes in the array must reflect the endianness of the computer system's architecture. For more information, see the Remarks section of the class topic. - -## Examples - The following code example converts elements of arrays to values with the `ToUInt64` method. - + +## Examples + The following code example converts elements of arrays to values with the `ToUInt64` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/CPP/batouint64.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System/BitConverter/ToUInt16/batouint64.cs" interactive="try-dotnet" id="Snippet3"::: :::code language="fsharp" source="~/snippets/fsharp/VS_Snippets_CLR_System/system.BitConverter.ToXXX.UInts/FS/batouint64.fs" id="Snippet3"::: diff --git a/xml/System/Char.xml b/xml/System/Char.xml index 421112328ec..6373ff80de7 100644 --- a/xml/System/Char.xml +++ b/xml/System/Char.xml @@ -3018,34 +3018,103 @@ The following code example demonstrates . : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the Unicode code points listed in the following table. - -||||| -|-|-|-|-| -|U+0021 to U+0023|U+060C and U+060D|U+1800 to U+180A|U+3014 to U+301F| -|U+0025 to U+002A|U+061B|U+1944 and U+1945|U+3030| -|U+002C to U+002F|U+061E and U+061F|U+19DE and U+19DF|U+303D| -|U+003A and U+003B|U+066A to U+066D|U+1A1E and U+1A1F|U+30A0| -|U+003F and U+0040|U+06D4|U+1B5A to U+1B60|U+30FB| -|U+005B to U+005D|U+0700 to U+070D|U+2010 to U+2027|U+A874 to U+A877| -|U+005F|U+07F7 to U+07F9|U+2030 to U+2043|U+FD3E and U+FD3F| -|U+007B|U+0964 and U+0965|U+2045 to U+2051|U+FE10 to U+FE19| -|U+007D|U+0970|U+2053 to U+205E|U+FE30 to U+FE52| -|U+00A1|U+0DF4|U+207D and U+207E|U+FE54 to U+FE61| -|U+00AB|U+0E4F to U+0E5B|U+208D and U+208E|U+FE63| -|U+00AD|U+0F04 to U+0F12|U+2329 and U+232A|U+FE68| -|U+00B7|U+0F3A to U+0F3D|U+2768 to U+2775|U+FE6A and U+FE6B| -|U+00BB|U+0F85|U+27C5 to U+27C6|U+FF01 to U+FF03| -|U+00BF|U+0FD0 and U+0FD1|U+27E6 to U+27EB|U+FF05 to U+FF0A| -|U+037E|U+104A to U+104F|U+2983 to U+2998|U+FF0C to U+FF0F| -|U+0387|U+10FB|U+29D8 to U+29DB|U+FF1A and U+FF1B| -|U+055A to U+055F|U+1361 to U+1368|U+29FC and U+29FD|U+FF1F and U+FF20| -|U+0589 and U+058A|U+166D and U+166E|U+2CF9 to U+2CFC|U+FF3B to U+FF3D| -|U+05BE|U+169B and U+169C|U+2CFE and U+2CFF|U+FF3F| -|U+05C0|U+16EB to U+16ED|U+2E00 to U+2E17|U+FF5B| -|U+05C3|U+1735 and U+1736|U+2E1C and U+2E1D|U+FF5D| -|U+05C6|U+17D4 to U+17D6|U+3001 to U+3003|U+FF5F to U+FF65| -|U+05F3 and U+05F4|U+17D8 to U+17DA|U+3008 to U+3011|| + Valid punctuation marks are members of the following categories in : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the following Unicode code points: + +- U+0021 to U+0023 +- U+060C and U+060D +- U+1800 to U+180A +- U+3014 to U+301F +- U+0025 to U+002A +- U+061B +- U+1944 and U+1945 +- U+3030 +- U+002C to U+002F +- U+061E and U+061F +- U+19DE and U+19DF +- U+303D +- U+003A and U+003B +- U+066A to U+066D +- U+1A1E and U+1A1F +- U+30A0 +- U+003F and U+0040 +- U+06D4 +- U+1B5A to U+1B60 +- U+30FB +- U+005B to U+005D +- U+0700 to U+070D +- U+2010 to U+2027 +- U+A874 to U+A877 +- U+005F +- U+07F7 to U+07F9 +- U+2030 to U+2043 +- U+FD3E and U+FD3F +- U+007B +- U+0964 and U+0965 +- U+2045 to U+2051 +- U+FE10 to U+FE19 +- U+007D +- U+0970 +- U+2053 to U+205E +- U+FE30 to U+FE52 +- U+00A1 +- U+0DF4 +- U+207D and U+207E +- U+FE54 to U+FE61 +- U+00AB +- U+0E4F to U+0E5B +- U+208D and U+208E +- U+FE63 +- U+00AD +- U+0F04 to U+0F12 +- U+2329 and U+232A +- U+FE68 +- U+00B7 +- U+0F3A to U+0F3D +- U+2768 to U+2775 +- U+FE6A and U+FE6B +- U+00BB +- U+0F85 +- U+27C5 to U+27C6 +- U+FF01 to U+FF03 +- U+00BF +- U+0FD0 and U+0FD1 +- U+27E6 to U+27EB +- U+FF05 to U+FF0A +- U+037E +- U+104A to U+104F +- U+2983 to U+2998 +- U+FF0C to U+FF0F +- U+0387 +- U+10FB +- U+29D8 to U+29DB +- U+FF1A and U+FF1B +- U+055A to U+055F +- U+1361 to U+1368 +- U+29FC and U+29FD +- U+FF1F and U+FF20 +- U+0589 and U+058A +- U+166D and U+166E +- U+2CF9 to U+2CFC +- U+FF3B to U+FF3D +- U+05BE +- U+169B and U+169C +- U+2CFE and U+2CFF +- U+FF3F +- U+05C0 +- U+16EB to U+16ED +- U+2E00 to U+2E17 +- U+FF5B +- U+05C3 +- U+1735 and U+1736 +- U+2E1C and U+2E1D +- U+FF5D +- U+05C6 +- U+17D4 to U+17D6 +- U+3001 to U+3003 +- U+FF5F to U+FF65 +- U+05F3 and U+05F4 +- U+17D8 to U+17DA +- U+3008 to U+3011 ## Examples The following code example demonstrates . @@ -3109,34 +3178,103 @@ The following code example demonstrates . : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the Unicode code points listed in the following table. - -||||| -|-|-|-|-| -|U+0021 to U+0023|U+060C and U+060D|U+1800 to U+180A|U+3014 to U+301F| -|U+0025 to U+002A|U+061B|U+1944 and U+1945|U+3030| -|U+002C to U+002F|U+061E and U+061F|U+19DE and U+19DF|U+303D| -|U+003A and U+003B|U+066A to U+066D|U+1A1E and U+1A1F|U+30A0| -|U+003F and U+0040|U+06D4|U+1B5A to U+1B60|U+30FB| -|U+005B to U+005D|U+0700 to U+070D|U+2010 to U+2027|U+A874 to U+A877| -|U+005F|U+07F7 to U+07F9|U+2030 to U+2043|U+FD3E and U+FD3F| -|U+007B|U+0964 and U+0965|U+2045 to U+2051|U+FE10 to U+FE19| -|U+007D|U+0970|U+2053 to U+205E|U+FE30 to U+FE52| -|U+00A1|U+0DF4|U+207D and U+207E|U+FE54 to U+FE61| -|U+00AB|U+0E4F to U+0E5B|U+208D and U+208E|U+FE63| -|U+00AD|U+0F04 to U+0F12|U+2329 and U+232A|U+FE68| -|U+00B7|U+0F3A to U+0F3D|U+2768 to U+2775|U+FE6A and U+FE6B| -|U+00BB|U+0F85|U+27C5 to U+27C6|U+FF01 to U+FF03| -|U+00BF|U+0FD0 and U+0FD1|U+27E6 to U+27EB|U+FF05 to U+FF0A| -|U+037E|U+104A to U+104F|U+2983 to U+2998|U+FF0C to U+FF0F| -|U+0387|U+10FB|U+29D8 to U+29DB|U+FF1A and U+FF1B| -|U+055A to U+055F|U+1361 to U+1368|U+29FC and U+29FD|U+FF1F and U+FF20| -|U+0589 and U+058A|U+166D and U+166E|U+2CF9 to U+2CFC|U+FF3B to U+FF3D| -|U+05BE|U+169B and U+169C|U+2CFE and U+2CFF|U+FF3F| -|U+05C0|U+16EB to U+16ED|U+2E00 to U+2E17|U+FF5B| -|U+05C3|U+1735 and U+1736|U+2E1C and U+2E1D|U+FF5D| -|U+05C6|U+17D4 to U+17D6|U+3001 to U+3003|U+FF5F to U+FF65| -|U+05F3 and U+05F4|U+17D8 to U+17DA|U+3008 to U+3011|| + Valid punctuation marks are members of the following categories in : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the following Unicode code points: + +- U+0021 to U+0023 +- U+060C and U+060D +- U+1800 to U+180A +- U+3014 to U+301F +- U+0025 to U+002A +- U+061B +- U+1944 and U+1945 +- U+3030 +- U+002C to U+002F +- U+061E and U+061F +- U+19DE and U+19DF +- U+303D +- U+003A and U+003B +- U+066A to U+066D +- U+1A1E and U+1A1F +- U+30A0 +- U+003F and U+0040 +- U+06D4 +- U+1B5A to U+1B60 +- U+30FB +- U+005B to U+005D +- U+0700 to U+070D +- U+2010 to U+2027 +- U+A874 to U+A877 +- U+005F +- U+07F7 to U+07F9 +- U+2030 to U+2043 +- U+FD3E and U+FD3F +- U+007B +- U+0964 and U+0965 +- U+2045 to U+2051 +- U+FE10 to U+FE19 +- U+007D +- U+0970 +- U+2053 to U+205E +- U+FE30 to U+FE52 +- U+00A1 +- U+0DF4 +- U+207D and U+207E +- U+FE54 to U+FE61 +- U+00AB +- U+0E4F to U+0E5B +- U+208D and U+208E +- U+FE63 +- U+00AD +- U+0F04 to U+0F12 +- U+2329 and U+232A +- U+FE68 +- U+00B7 +- U+0F3A to U+0F3D +- U+2768 to U+2775 +- U+FE6A and U+FE6B +- U+00BB +- U+0F85 +- U+27C5 to U+27C6 +- U+FF01 to U+FF03 +- U+00BF +- U+0FD0 and U+0FD1 +- U+27E6 to U+27EB +- U+FF05 to U+FF0A +- U+037E +- U+104A to U+104F +- U+2983 to U+2998 +- U+FF0C to U+FF0F +- U+0387 +- U+10FB +- U+29D8 to U+29DB +- U+FF1A and U+FF1B +- U+055A to U+055F +- U+1361 to U+1368 +- U+29FC and U+29FD +- U+FF1F and U+FF20 +- U+0589 and U+058A +- U+166D and U+166E +- U+2CF9 to U+2CFC +- U+FF3B to U+FF3D +- U+05BE +- U+169B and U+169C +- U+2CFE and U+2CFF +- U+FF3F +- U+05C0 +- U+16EB to U+16ED +- U+2E00 to U+2E17 +- U+FF5B +- U+05C3 +- U+1735 and U+1736 +- U+2E1C and U+2E1D +- U+FF5D +- U+05C6 +- U+17D4 to U+17D6 +- U+3001 to U+3003 +- U+FF5F to U+FF65 +- U+05F3 and U+05F4 +- U+17D8 to U+17DA +- U+3008 to U+3011 ]]> @@ -3204,34 +3342,103 @@ The following code example demonstrates . ## Remarks Character positions in a string are indexed starting from zero. - Valid punctuation marks are members of the following categories in : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the Unicode code points listed in the following table. - -||||| -|-|-|-|-| -|U+0021 to U+0023|U+060C and U+060D|U+1800 to U+180A|U+3014 to U+301F| -|U+0025 to U+002A|U+061B|U+1944 and U+1945|U+3030| -|U+002C to U+002F|U+061E and U+061F|U+19DE and U+19DF|U+303D| -|U+003A and U+003B|U+066A to U+066D|U+1A1E and U+1A1F|U+30A0| -|U+003F and U+0040|U+06D4|U+1B5A to U+1B60|U+30FB| -|U+005B to U+005D|U+0700 to U+070D|U+2010 to U+2027|U+A874 to U+A877| -|U+005F|U+07F7 to U+07F9|U+2030 to U+2043|U+FD3E and U+FD3F| -|U+007B|U+0964 and U+0965|U+2045 to U+2051|U+FE10 to U+FE19| -|U+007D|U+0970|U+2053 to U+205E|U+FE30 to U+FE52| -|U+00A1|U+0DF4|U+207D and U+207E|U+FE54 to U+FE61| -|U+00AB|U+0E4F to U+0E5B|U+208D and U+208E|U+FE63| -|U+00AD|U+0F04 to U+0F12|U+2329 and U+232A|U+FE68| -|U+00B7|U+0F3A to U+0F3D|U+2768 to U+2775|U+FE6A and U+FE6B| -|U+00BB|U+0F85|U+27C5 to U+27C6|U+FF01 to U+FF03| -|U+00BF|U+0FD0 and U+0FD1|U+27E6 to U+27EB|U+FF05 to U+FF0A| -|U+037E|U+104A to U+104F|U+2983 to U+2998|U+FF0C to U+FF0F| -|U+0387|U+10FB|U+29D8 to U+29DB|U+FF1A and U+FF1B| -|U+055A to U+055F|U+1361 to U+1368|U+29FC and U+29FD|U+FF1F and U+FF20| -|U+0589 and U+058A|U+166D and U+166E|U+2CF9 to U+2CFC|U+FF3B to U+FF3D| -|U+05BE|U+169B and U+169C|U+2CFE and U+2CFF|U+FF3F| -|U+05C0|U+16EB to U+16ED|U+2E00 to U+2E17|U+FF5B| -|U+05C3|U+1735 and U+1736|U+2E1C and U+2E1D|U+FF5D| -|U+05C6|U+17D4 to U+17D6|U+3001 to U+3003|U+FF5F to U+FF65| -|U+05F3 and U+05F4|U+17D8 to U+17DA|U+3008 to U+3011|| + Valid punctuation marks are members of the following categories in : `ConnectorPunctuation`, `DashPunctuation`, `OpenPunctuation`, `ClosePunctuation`, `InitialQuotePunctuation`, `FinalQuotePunctuation`, or `OtherPunctuation`. They include characters with the following Unicode code points: + +- U+0021 to U+0023 +- U+060C and U+060D +- U+1800 to U+180A +- U+3014 to U+301F +- U+0025 to U+002A +- U+061B +- U+1944 and U+1945 +- U+3030 +- U+002C to U+002F +- U+061E and U+061F +- U+19DE and U+19DF +- U+303D +- U+003A and U+003B +- U+066A to U+066D +- U+1A1E and U+1A1F +- U+30A0 +- U+003F and U+0040 +- U+06D4 +- U+1B5A to U+1B60 +- U+30FB +- U+005B to U+005D +- U+0700 to U+070D +- U+2010 to U+2027 +- U+A874 to U+A877 +- U+005F +- U+07F7 to U+07F9 +- U+2030 to U+2043 +- U+FD3E and U+FD3F +- U+007B +- U+0964 and U+0965 +- U+2045 to U+2051 +- U+FE10 to U+FE19 +- U+007D +- U+0970 +- U+2053 to U+205E +- U+FE30 to U+FE52 +- U+00A1 +- U+0DF4 +- U+207D and U+207E +- U+FE54 to U+FE61 +- U+00AB +- U+0E4F to U+0E5B +- U+208D and U+208E +- U+FE63 +- U+00AD +- U+0F04 to U+0F12 +- U+2329 and U+232A +- U+FE68 +- U+00B7 +- U+0F3A to U+0F3D +- U+2768 to U+2775 +- U+FE6A and U+FE6B +- U+00BB +- U+0F85 +- U+27C5 to U+27C6 +- U+FF01 to U+FF03 +- U+00BF +- U+0FD0 and U+0FD1 +- U+27E6 to U+27EB +- U+FF05 to U+FF0A +- U+037E +- U+104A to U+104F +- U+2983 to U+2998 +- U+FF0C to U+FF0F +- U+0387 +- U+10FB +- U+29D8 to U+29DB +- U+FF1A and U+FF1B +- U+055A to U+055F +- U+1361 to U+1368 +- U+29FC and U+29FD +- U+FF1F and U+FF20 +- U+0589 and U+058A +- U+166D and U+166E +- U+2CF9 to U+2CFC +- U+FF3B to U+FF3D +- U+05BE +- U+169B and U+169C +- U+2CFE and U+2CFF +- U+FF3F +- U+05C0 +- U+16EB to U+16ED +- U+2E00 to U+2E17 +- U+FF5B +- U+05C3 +- U+1735 and U+1736 +- U+2E1C and U+2E1D +- U+FF5D +- U+05C6 +- U+17D4 to U+17D6 +- U+3001 to U+3003 +- U+FF5F to U+FF65 +- U+05F3 and U+05F4 +- U+17D8 to U+17DA +- U+3008 to U+3011 ]]> From a87be4abdcdb90aaba1301cda924511d3fe7ffe4 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:17:31 -0800 Subject: [PATCH 2/2] oopsies --- xml/System.Xml/XmlValidatingReader.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xml/System.Xml/XmlValidatingReader.xml b/xml/System.Xml/XmlValidatingReader.xml index b4474c51243..97d3b093579 100644 --- a/xml/System.Xml/XmlValidatingReader.xml +++ b/xml/System.Xml/XmlValidatingReader.xml @@ -830,8 +830,8 @@ ## Examples The following example uses the `ResolveEntity` method to expand a general entity. - [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/sour| [!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)] | -|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|cs#1)] +[!code-cpp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/cpp/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/CPP/source.cpp#1)] + [!code-csharp[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/csharp/System.Xml/XmlValidatingReader/EntityHandling/source.cs#1)] [!code-vb[Classic WebData XmlValidatingReader.ResolveEntity Example#1](~/snippets/visualbasic/VS_Snippets_Data/Classic WebData XmlValidatingReader.ResolveEntity Example/VB/source.vb#1)] The example uses the file, `book1.xml`, as input.