From 2f63abb027b5be2908f728e7cbfdc67efdfe4bd9 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 25 Apr 2025 07:07:51 -0700 Subject: [PATCH 1/3] add language slugs (#11227) --- xml/System.Globalization/CultureInfo.xml | 12 +++---- .../MemoryMappedFile.xml | 35 +++++++------------ xml/System.IO/BufferedStream.xml | 28 --------------- xml/System.IO/FileInfo.xml | 2 +- xml/System.IO/Path.xml | 2 +- 5 files changed, 19 insertions(+), 60 deletions(-) diff --git a/xml/System.Globalization/CultureInfo.xml b/xml/System.Globalization/CultureInfo.xml index 8ea383ecf9b..51142c64115 100644 --- a/xml/System.Globalization/CultureInfo.xml +++ b/xml/System.Globalization/CultureInfo.xml @@ -1279,21 +1279,19 @@ You might choose to override some of the values associated with the current cult property lets you define the default UI culture of all threads in an application domain. + In the .NET Framework 4 and previous versions, by default, the UI culture of all threads is set to the Windows system culture. For applications whose current UI culture differs from the default system culture, this behavior is often undesirable. In .NET Framework 4.5+, the property lets you define the default UI culture of all threads in an application domain. > [!IMPORTANT] > If you have not explicitly set the UI culture of any existing threads executing in an application domain, setting the property also changes the culture of these threads. However, if these threads execute in another application domain, their culture is defined by the property in that application domain or, if no default value is defined, by the default system culture. Because of this, we recommend that you always explicitly set the culture of your main application thread and do not rely on the property to define the culture of the main application thread. Unless it is set explicitly, the value of the property is `null`, and the current culture of all threads in an application domain that have not been assigned an explicit culture is defined by the default Windows system culture. - For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections in the reference page. - - + For more information about cultures, threads, and application domains, see the "Culture and threads" and "Culture and application domains" sections of . ## Examples - The following example illustrates the default behavior of the .NET Framework in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources: + The following example illustrates the default behavior of .NET in defining the current culture of a new thread. It uses English and Russian language resources. The following text file named GreetingStrings.txt contains the English language resources: -``` +```txt greeting =Hello again! newGreeting=Hello! ``` @@ -1306,7 +1304,7 @@ resgen greetingstrings.txt The following text file named GreetingStrings.ru-RU.txt contains the Russian language resources: -``` +```txt greeting=Еще раз привет! newGreeting=Привет! ``` diff --git a/xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml b/xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml index cb3dc8b51d1..a357af7b45b 100644 --- a/xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml +++ b/xml/System.IO.MemoryMappedFiles/MemoryMappedFile.xml @@ -896,38 +896,27 @@ ## Remarks Use this method to create a memory-mapped file that is not persisted (that is, not associated with a file on disk), which you can use to share data between processes. - - ## Examples The following example is composed of three separate processes (console applications) that write `Boolean` values to a memory-mapped file. The following sequence of actions occur: -1. Process A creates the memory-mapped file and writes a value to it. - -2. Process B opens the memory-mapped file and writes a value to it. - -3. Process C opens the memory-mapped file and writes a value to it. - -4. Process A reads and displays the values from the memory-mapped file. - -5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection. +1. Process A creates the memory-mapped file and writes a value to it. +2. Process B opens the memory-mapped file and writes a value to it. +3. Process C opens the memory-mapped file and writes a value to it. +4. Process A reads and displays the values from the memory-mapped file. +5. After Process A is finished with the memory-mapped file, the file is immediately reclaimed by garbage collection. To run this example, do the following: -1. Compile the applications and open three Command windows. - -2. In the first Command window, run Process A. - -3. In the second Command window, run Process B. - -4. Return to Process A and press ENTER. - -5. In the third Command window, run Process C. - -6. Return to Process A and press ENTER. +1. Compile the applications and open three Command windows. +2. In the first Command window, run Process A. +3. In the second Command window, run Process B. +4. Return to Process A and press ENTER. +5. In the third Command window, run Process C. +6. Return to Process A and press ENTER. The output of Process A is as follows: -``` +```txt Start Process B and press ENTER to continue. Start Process C and press ENTER to continue. Process A says: True diff --git a/xml/System.IO/BufferedStream.xml b/xml/System.IO/BufferedStream.xml index c5388fdd3d0..df243abb082 100644 --- a/xml/System.IO/BufferedStream.xml +++ b/xml/System.IO/BufferedStream.xml @@ -743,34 +743,6 @@ Flushing the stream will not flush its underlying encoder unless you explicitly Attempting to manipulate a stream after it has been closed might throw an . -## Examples -This code example is part of a larger example provided for the class. - -```vb -' When bufStream is closed, netStream is in turn -' closed, which in turn shuts down the connection -' and closes clientSocket. -Console.WriteLine(vbCrLf & "Shutting down the connection.") -bufStream.Close() -``` - -```csharp -// When bufStream is closed, netStream is in turn -// closed, which in turn shuts down the connection -// and closes clientSocket. -Console.WriteLine("\nShutting down the connection."); -bufStream.Close(); -``` - -```cpp -// When bufStream is closed, netStream is in turn closed, -// which in turn shuts down the connection and closes -// clientSocket. -Console::WriteLine( "\nShutting down connection." ); -bufStream->Close(); - -``` - ]]> An error occurred while trying to close the stream. diff --git a/xml/System.IO/FileInfo.xml b/xml/System.IO/FileInfo.xml index 812e75e9afe..b451dfe584b 100644 --- a/xml/System.IO/FileInfo.xml +++ b/xml/System.IO/FileInfo.xml @@ -129,7 +129,7 @@ This example produces output similar to the following. -``` +```txt Hello And Welcome diff --git a/xml/System.IO/Path.xml b/xml/System.IO/Path.xml index 8da19dd3f90..1d510fd98f9 100644 --- a/xml/System.IO/Path.xml +++ b/xml/System.IO/Path.xml @@ -2209,7 +2209,7 @@ Console.WriteLine(result); This example produces output similar to the following. -``` +```txt C:\Users\UserName\AppData\Local\Temp\ ``` From e9f43a50d9d626cac20118c36fd5c3644e0ba90c Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Fri, 25 Apr 2025 09:56:10 -0700 Subject: [PATCH 2/3] Remove invalid exceptions (#11244) --- xml/System.IO/Directory.xml | 52 +++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/xml/System.IO/Directory.xml b/xml/System.IO/Directory.xml index 55b83a59be4..3d820f957cc 100644 --- a/xml/System.IO/Directory.xml +++ b/xml/System.IO/Directory.xml @@ -983,12 +983,13 @@ An I/O error occurred. does not contain a valid pattern. or is . - - is not a valid value. is invalid, such as referring to an unmapped drive. @@ -1397,8 +1396,6 @@ The returned collection is not cached. Each call to the is . - - is not a valid value. is invalid, such as referring to an unmapped drive. @@ -1740,12 +1737,13 @@ The returned collection is not cached. Each call to the is . - - is not a valid value. is invalid, such as referring to an unmapped drive. @@ -2634,10 +2630,10 @@ The returned collection is not cached. Each call to the Date: Fri, 25 Apr 2025 12:16:48 -0700 Subject: [PATCH 3/3] add language slugs (#11216) --- xml/System.Web.Caching/SqlCacheDependency.xml | 4 +- .../RouteUrlExpressionBuilder.xml | 4 +- .../RouteValueExpressionBuilder.xml | 2 +- .../AuthorizationSection.xml | 2 +- xml/System.Web.Configuration/ClientTarget.xml | 2 +- .../ClientTargetCollection.xml | 2 +- .../ClientTargetSection.xml | 2 +- .../HttpCapabilitiesBase.xml | 12 +- .../HttpHandlerAction.xml | 2 +- .../HttpHandlersSection.xml | 2 +- .../HttpModulesSection.xml | 2 +- .../PagesEnableSessionState.xml | 3 +- xml/System.Web.Configuration/PagesSection.xml | 2 +- .../PassportAuthentication.xml | 2 +- .../SessionStateSection.xml | 2 +- xml/System.Web.DynamicData/DynamicControl.xml | 42 +- xml/System.Web.DynamicData/DynamicField.xml | 2 +- .../WebFailureAuditEvent.xml | 2 +- xml/System.Web.Profile/ProfileGroupBase.xml | 2 +- xml/System.Web.Profile/ProfileManager.xml | 12 +- xml/System.Web.Routing/PageRouteHandler.xml | 2 +- xml/System.Web.Routing/UrlRoutingHandler.xml | 4 +- .../JavaScriptTypeResolver.xml | 52 +- .../AntiXssEncoder.xml | 5 +- .../ActiveDirectoryMembershipProvider.xml | 18 +- .../AuthorizationStoreRoleProvider.xml | 4 +- .../FormsAuthentication.xml | 22 +- xml/System.Web.Security/Roles.xml | 28 +- xml/System.Web.Security/SqlRoleProvider.xml | 4 +- .../UrlAuthorizationModule.xml | 4 +- .../WindowsTokenRoleProvider.xml | 4 +- .../HttpSessionState.xml | 12 +- .../IHttpSessionState.xml | 2 +- .../SessionIDManager.xml | 4 +- .../SessionStateStoreProviderBase.xml | 2 +- .../SessionStateUtility.xml | 2 +- .../DeviceSpecificChoice.xml | 4 +- .../AccessDataSource.xml | 1130 +++++------ xml/System.Web.UI.WebControls/AdRotator.xml | 1166 ++++++------ .../BulletedList.xml | 116 +- xml/System.Web.UI.WebControls/Button.xml | 88 +- xml/System.Web.UI.WebControls/Calendar.xml | 1678 ++++++++--------- .../ChangePassword.xml | 244 +-- xml/System.Web.UI.WebControls/CheckBox.xml | 80 +- .../CheckBoxList.xml | 120 +- xml/System.Web.UI.WebControls/Content.xml | 226 +-- .../ContentPlaceHolder.xml | 92 +- .../CreateUserWizard.xml | 441 +++-- .../CustomValidator.xml | 4 +- xml/System.Web.UI.WebControls/DataGrid.xml | 360 ++-- xml/System.Web.UI.WebControls/DataList.xml | 162 +- xml/System.Web.UI.WebControls/DataPager.xml | 758 ++++---- xml/System.Web.UI.WebControls/DetailsView.xml | 604 +++--- .../DropDownList.xml | 382 ++-- .../EmbeddedMailObject.xml | 4 +- .../EntityDataSource.xml | 146 +- xml/System.Web.UI.WebControls/FileUpload.xml | 496 ++--- xml/System.Web.UI.WebControls/FormView.xml | 224 +-- xml/System.Web.UI.WebControls/GridView.xml | 608 +++--- xml/System.Web.UI.WebControls/HiddenField.xml | 30 +- xml/System.Web.UI.WebControls/HotSpot.xml | 2 +- xml/System.Web.UI.WebControls/Label.xml | 70 +- xml/System.Web.UI.WebControls/LinkButton.xml | 86 +- xml/System.Web.UI.WebControls/ListView.xml | 156 +- xml/System.Web.UI.WebControls/Literal.xml | 30 +- xml/System.Web.UI.WebControls/Login.xml | 156 +- .../ObjectDataSource.xml | 740 ++++---- .../PasswordRecovery.xml | 196 +- .../RadioButtonList.xml | 120 +- xml/System.Web.UI.WebControls/SiteMapPath.xml | 110 +- .../SqlDataSource.xml | 736 ++++---- xml/System.Web.UI.WebControls/Style.xml | 4 +- xml/System.Web.UI.WebControls/Table.xml | 812 ++++---- xml/System.Web.UI.WebControls/TextBox.xml | 93 +- xml/System.Web.UI.WebControls/TreeView.xml | 504 ++--- xml/System.Web.UI.WebControls/WebControl.xml | 4 +- xml/System.Web.UI.WebControls/Wizard.xml | 268 +-- xml/System.Web.UI/ChtmlTextWriter.xml | 2 +- xml/System.Web.UI/ClientIDMode.xml | 42 +- xml/System.Web.UI/Control.xml | 2 +- xml/System.Web.UI/ScriptReferenceBase.xml | 2 +- xml/System.Web/HttpContext.xml | 3 - xml/System.Web/HttpRequest.xml | 1 - 83 files changed, 6773 insertions(+), 6803 deletions(-) diff --git a/xml/System.Web.Caching/SqlCacheDependency.xml b/xml/System.Web.Caching/SqlCacheDependency.xml index fd1a1dcfeaa..29a926e2a49 100644 --- a/xml/System.Web.Caching/SqlCacheDependency.xml +++ b/xml/System.Web.Caching/SqlCacheDependency.xml @@ -145,7 +145,7 @@ The database name passed to the `database` parameter must be defined in the application's Web.config file. For example, the following Web.config file defines a database named pubs for change notifications. -``` +```xml @@ -247,7 +247,7 @@ ## Remarks The following markup shows a typical output-cache dependency directive. -``` +```xml <%@ OutputCache Duration="3600" SqlDependency="Northwind:Employees" VaryByParam="none" %> ``` diff --git a/xml/System.Web.Compilation/RouteUrlExpressionBuilder.xml b/xml/System.Web.Compilation/RouteUrlExpressionBuilder.xml index 709b2acd5c3..975c8f26199 100644 --- a/xml/System.Web.Compilation/RouteUrlExpressionBuilder.xml +++ b/xml/System.Web.Compilation/RouteUrlExpressionBuilder.xml @@ -36,7 +36,7 @@ ## Examples The following example shows how to create markup that generates a hyperlink with a URL that is formatted for a route. The route is defined by using `http://www.contoso.com/search/{searchterm}` as the URL pattern. -``` +```xml Search for Bicycles @@ -47,7 +47,7 @@ If the URL parameters provided to the `RouteUrl` expression are not sufficient to uniquely identify a route, you must include the route name. For example, if a Web application has two routes with `searchterm` as the sole URL parameter, the routes would have to be defined by using route names, and the hyperlink markup would resemble the following example: -``` +```xml diff --git a/xml/System.Web.Compilation/RouteValueExpressionBuilder.xml b/xml/System.Web.Compilation/RouteValueExpressionBuilder.xml index 8fa1a8d4ed7..2bb79851288 100644 --- a/xml/System.Web.Compilation/RouteValueExpressionBuilder.xml +++ b/xml/System.Web.Compilation/RouteValueExpressionBuilder.xml @@ -36,7 +36,7 @@ ## Examples The following example shows how to use markup to display the value of the URL parameter `searchterm`. The route is defined by using `http://www.contoso.com/search/{searchterm}` as the URL pattern. -``` +```xml diff --git a/xml/System.Web.Configuration/AuthorizationSection.xml b/xml/System.Web.Configuration/AuthorizationSection.xml index e97c5ad624f..db1d930e0b0 100644 --- a/xml/System.Web.Configuration/AuthorizationSection.xml +++ b/xml/System.Web.Configuration/AuthorizationSection.xml @@ -35,7 +35,7 @@ > [!NOTE] > If you use the `credentials` section, be sure to follow the guidelines explained at [ASP.NET Authentication](https://learn.microsoft.com/previous-versions/aspnet/eeyk640h(v=vs.100)). For scalability and better security capability, it is recommended that you use an external database to store the users' credentials. For more information about building secure ASP.NET applications, see [Securing Your ASP.NET Application](https://learn.microsoft.com/archive/msdn-magazine/2012/january/asp-net-security-securing-your-asp-net-applications) and [Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication](https://learn.microsoft.com/previous-versions/msp-n-p/ff649357(v=pandp.10)). -``` +```xml diff --git a/xml/System.Web.Configuration/ClientTarget.xml b/xml/System.Web.Configuration/ClientTarget.xml index 43ae7b390bc..1a648ce9c91 100644 --- a/xml/System.Web.Configuration/ClientTarget.xml +++ b/xml/System.Web.Configuration/ClientTarget.xml @@ -37,7 +37,7 @@ The following code example shows how to declaratively specify values for several properties of the class. -``` +```xml class. -``` +```xml diff --git a/xml/System.Web.Configuration/HttpCapabilitiesBase.xml b/xml/System.Web.Configuration/HttpCapabilitiesBase.xml index 41557b7b9e2..72f51d0d73d 100644 --- a/xml/System.Web.Configuration/HttpCapabilitiesBase.xml +++ b/xml/System.Web.Configuration/HttpCapabilitiesBase.xml @@ -2349,7 +2349,7 @@ ## Remarks Intended for internal use only. Some browsers require a meta-tag similar to the following for the browser to render properly. -``` +```html ``` @@ -2421,14 +2421,12 @@ ## Remarks If `true`, server-control adapters insert the following tag into the HTML `` element of a Web page: -``` +```html ``` In this example, `CONTENT` is the value returned by the property, and `charset` is the character encoding used. - - ## Examples The following code example shows how to determine whether the browser requires an HTML `` element for which the `content-type` attribute is specified. @@ -2724,7 +2722,7 @@ ## Remarks HTTP is a stateless protocol, and `VIEWSTATE` is one mechanism used to persist client changes across multiple requests. Each control on a Web page contains a property, which represents the accumulation of any changes made by the client. In a Web Forms page, these changes are encoded in postback data as the `value` of an HTML `` element with a `type` attribute of `hidden`. For example: -``` +```html ``` @@ -3147,7 +3145,7 @@ ## Remarks The `cache-control` value for the `http-equiv` attribute of HTML `` elements allows control over client caching of downloaded content, which includes Web pages. The following HTML fragment shows an example: -``` +```html ``` @@ -3157,7 +3155,7 @@ The property also applies to the equivalent HTTP header form: -``` +```txt CACHE-CONTROL: NO-CACHE ``` diff --git a/xml/System.Web.Configuration/HttpHandlerAction.xml b/xml/System.Web.Configuration/HttpHandlerAction.xml index 109a34b2090..bc2e6611acd 100644 --- a/xml/System.Web.Configuration/HttpHandlerAction.xml +++ b/xml/System.Web.Configuration/HttpHandlerAction.xml @@ -39,7 +39,7 @@ The following configuration excerpt shows how to specify values declaratively for the `httpHandlers` section. -``` +```xml - ``` The following code example shows how to use the enumeration with the type. diff --git a/xml/System.Web.Configuration/PagesSection.xml b/xml/System.Web.Configuration/PagesSection.xml index fab4104fa7f..797b86d5076 100644 --- a/xml/System.Web.Configuration/PagesSection.xml +++ b/xml/System.Web.Configuration/PagesSection.xml @@ -31,7 +31,7 @@ The following configuration file example shows how to specify values declaratively for the [pages](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/950xf363(v=vs.100)) section. -``` +```xml object from the configuration file of an existing Web application. Also shown is a configuration example. -``` +```xml diff --git a/xml/System.Web.Configuration/SessionStateSection.xml b/xml/System.Web.Configuration/SessionStateSection.xml index 62db29a4f16..b551b8eec1e 100644 --- a/xml/System.Web.Configuration/SessionStateSection.xml +++ b/xml/System.Web.Configuration/SessionStateSection.xml @@ -33,7 +33,7 @@ The following configuration file example shows how to specify values declaratively for the `sessionState` section. -``` +```xml ## Declarative Syntax -``` +```xml ``` diff --git a/xml/System.Web.DynamicData/DynamicField.xml b/xml/System.Web.DynamicData/DynamicField.xml index c98bfa97a8e..2f3d0f1d99c 100644 --- a/xml/System.Web.DynamicData/DynamicField.xml +++ b/xml/System.Web.DynamicData/DynamicField.xml @@ -60,7 +60,7 @@ ## Declarative Syntax -``` +```xml event. -``` +```xml diff --git a/xml/System.Web.Profile/ProfileGroupBase.xml b/xml/System.Web.Profile/ProfileGroupBase.xml index e065f7c0edd..0c1a33d6841 100644 --- a/xml/System.Web.Profile/ProfileGroupBase.xml +++ b/xml/System.Web.Profile/ProfileGroupBase.xml @@ -130,7 +130,7 @@ ## Examples The following Web.config file specifies a user profile that contains a group of properties with a group name of `Address`. The grouped properties generated for the property of the current will be preceded by the group name, for example, `Profile.Address.Street`. -``` +```xml diff --git a/xml/System.Web.Profile/ProfileManager.xml b/xml/System.Web.Profile/ProfileManager.xml index f3ffa4ae765..e60b5c7af95 100644 --- a/xml/System.Web.Profile/ProfileManager.xml +++ b/xml/System.Web.Profile/ProfileManager.xml @@ -26,7 +26,7 @@ By default, the user profile is disabled for all ASP.NET applications. To enable the user profile, set the `enabled` attribute of the [profile](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164644(v%3dvs.100)) configuration element to true, as shown in the following example. -``` +```xml @@ -38,7 +38,7 @@ A profile provider is used to store and retrieve properties in the user profile. The .NET Framework includes a class that stores user profile properties in a SQL Server database. A instance named `AspNetSqlProvider` is specified in the machine configuration as the default profile provider. The `AspNetSqlProvider` instance connects to the SQL Server database on the local Web server. You can specify a that connects to another SQL Server as the default profile provider by using the [providers](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164654(v%3dvs.100)) configuration element and the `defaultProvider` attribute of the [profile](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164644(v%3dvs.100)) configuration element, as shown in the following example. -``` +```xml instance and sets the to `MyApplication`. -``` +```xml instance and sets the `automaticSaveEnabled` attribute to `true`. -``` +```xml @@ -477,7 +477,7 @@ ## Examples The following code example shows the [profile](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164644(v%3dvs.100)) element in the [system.web](/dotnet/framework/configure-apps/file-schema/web/system-web-element-web-settings) section of the Web.config file for an ASP.NET application where the user profile has been enabled. -``` +```xml property references all of the profile providers enabled for an application, including providers added in the machine configuration and providers added in all Web.config files. You can control which profile providers are available for an application using the [providers](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164654(v%3dvs.100)) element of the [profile](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164644(v%3dvs.100)) section in the configuration file. For example, the following Web.config file removes the profile providers specified in parent configuration files and adds a instance as the profile provider for the application. -``` +```xml diff --git a/xml/System.Web.Routing/UrlRoutingHandler.xml b/xml/System.Web.Routing/UrlRoutingHandler.xml index c79d72954b7..66b37885d63 100644 --- a/xml/System.Web.Routing/UrlRoutingHandler.xml +++ b/xml/System.Web.Routing/UrlRoutingHandler.xml @@ -42,7 +42,7 @@ To register a customized handler for a particular file name extension, you must add that handler in the Web.config file. The following example shows how to register a customized handler for an ASP.NET Web site that is running in IIS 6.0 or IIS 7.0 in Classic mode. -``` +```xml Provides the abstract base class for implementing a custom type resolver. - class provides the services for: - -- Converting managed type information to a string value through the method. - -- Resolving a string value back to the appropriate managed type through the method. - - When the object serializes custom types, it can optionally include in the serialized JavaScript Object Notation (JSON) string a value that contains type information. During deserialization, can then reference this string value to determine the appropriate managed type to which the JSON string will be converted. - - If you provide a type resolver to the instance, the serializer will use the and methods to map between the managed type and the string value during the serialization and deserialization process, respectively. - - The class is the base class for the class, which provides an implementation of a type resolver that uses the managed type assembly-qualified name. + class provides the services for: + +- Converting managed type information to a string value through the method. + +- Resolving a string value back to the appropriate managed type through the method. + + When the object serializes custom types, it can optionally include in the serialized JavaScript Object Notation (JSON) string a value that contains type information. During deserialization, can then reference this string value to determine the appropriate managed type to which the JSON string will be converted. + + If you provide a type resolver to the instance, the serializer will use the and methods to map between the managed type and the string value during the serialization and deserialization process, respectively. + + The class is the base class for the class, which provides an implementation of a type resolver that uses the managed type assembly-qualified name. > [!NOTE] > When using a `JavaScriptTypeResolver`, the resulting JSON payload contains a special `__type` property. This property includes the full type name, including namespace, of the target type. Before using a custom resolver, verify that the full name of the target type does not contain sensitive or privileged information. -## Examples +## Examples The following example shows how to create a custom `JavaScriptTypeResolver` and how to use it to serialize or deserialize an object. -```cs + ```csharp using System; using System.Linq; using System.Web.Script.Serialization; @@ -261,7 +261,7 @@ Even though the app only expects `Person` and `Adult` instances to be deserializ > [!WARNING] > Do not call `Type.GetType(id)` within the `ResolveType` method. This could introduce a security vunerability into the app. Instead, iterate through the list of allowed types and compare their `Type.FullName` property against the incoming `id`, as shown in the preceding sample. - + ]]> @@ -317,10 +317,10 @@ Even though the app only expects `Person` and `Adult` instances to be deserializ When overridden in a derived class, returns the object that is associated with the specified type name. The object that is associated with the specified type name. - instance, the serializer uses the method when it iterates through a JSON string to determine the specific managed type to which the JSON type should be converted. + instance, the serializer uses the method when it iterates through a JSON string to determine the specific managed type to which the JSON type should be converted. ]]> @@ -353,11 +353,11 @@ Even though the app only expects `Person` and `Adult` instances to be deserializ When overridden in a derived class, returns the type name for the specified object. The name of the specified managed type. - method returns either `null` or , then the type resolver does not support the type. - + method returns either `null` or , then the type resolver does not support the type. + ]]> diff --git a/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml b/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml index b251b2e5413..c9bc890b80a 100644 --- a/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml +++ b/xml/System.Web.Security.AntiXss/AntiXssEncoder.xml @@ -25,7 +25,7 @@ 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: -``` +```xml ``` @@ -602,8 +602,7 @@ The following table lists the default safe characters. All characters are from t To add support for the Japanese language while continuing to allow English, use the following syntax: -``` - +```csharp MarkAsSafe( LowerCodeCharts.Default, LowerMidCodeCharts.HangulJamo, diff --git a/xml/System.Web.Security/ActiveDirectoryMembershipProvider.xml b/xml/System.Web.Security/ActiveDirectoryMembershipProvider.xml index 501882bf0aa..a35da1a4efc 100644 --- a/xml/System.Web.Security/ActiveDirectoryMembershipProvider.xml +++ b/xml/System.Web.Security/ActiveDirectoryMembershipProvider.xml @@ -521,7 +521,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to use the SSL security protocol to connect to an Active Directory server. -``` +```xml @@ -726,7 +726,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to enable searching an Active Directory server. -``` +```xml @@ -1472,7 +1472,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to lock out users who make three failed attempts to enter the password answer in a 10-minute time window. If the user is locked out, no further attempts to answer the password question may be made for 15 minutes. -``` +```xml @@ -1533,7 +1533,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following example shows the [membership Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/1b9hw62f(v=vs.100)) configuration element in the `system.web` section of the application's Web.config file. It specifies that the application use an instance of the class to provide membership services, and sets the `minRequiredNonalphanumericCharacters` attribute to one character. -``` +```xml @@ -1590,7 +1590,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following example shows the [membership Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/1b9hw62f(v=vs.100)) configuration element in the `system.web` section of the application's Web.config file. It specifies that the application use an instance of the class to provide membership services, and sets the `minRequiredPasswordLength` attribute to seven characters. -``` +```xml @@ -1651,7 +1651,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to lock out users who make three failed attempts to enter the password answer in a 10-minute time window. If the user is locked out, no further attempts to answer the password question may be made for 15 minutes. -``` +```xml @@ -1712,7 +1712,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to lock out users who make three failed attempts to enter the password answer in a 10-minute time window. If the user is locked out, no further attempts to answer the password question may be made for 15 minutes. -``` +```xml @@ -1811,7 +1811,7 @@ The following example shows the Web.config file for an ASP.NET application confi If the password does not meet these criteria, the password is not accepted by the membership provider. -``` +```xml @@ -1910,7 +1910,7 @@ The following example shows the Web.config file for an ASP.NET application confi ## Examples The following code example shows a Web.config entry that configures an instance to require unique email addresses for users stored on the Active Directory server. -``` +```xml diff --git a/xml/System.Web.Security/AuthorizationStoreRoleProvider.xml b/xml/System.Web.Security/AuthorizationStoreRoleProvider.xml index 9308e0e8c69..6a2d847b375 100644 --- a/xml/System.Web.Security/AuthorizationStoreRoleProvider.xml +++ b/xml/System.Web.Security/AuthorizationStoreRoleProvider.xml @@ -26,7 +26,7 @@ You can configure the object to use either a local XML file or an Active Directory or Active Directory Application Mode (ADAM) server. When using a local file, the connection string should look like the following example. -``` +```txt msxml:// ``` @@ -254,7 +254,7 @@ msxml:// ## Examples The following example shows the \ element in the `system.web` section of the Web.config file for an ASP.NET application. It specifies the application's instance and sets the property to `MyApplication`. -``` +```xml @@ -183,7 +183,7 @@ This method is obsolete. The recommended alternative is to use the Membership AP ## Examples The following code example sets the `domain` attribute in the Web.config file. -``` +```xml @@ -301,7 +301,7 @@ This method is obsolete. The recommended alternative is to use the Membership AP ## Examples The following code example sets the `cookieless` attribute to in the Web.config file. This configuration will result in the property returning `false`. -``` +```xml @@ -385,7 +385,7 @@ This method is obsolete. The recommended alternative is to use the Membership AP ## Examples The following code example sets the `defaultUrl` attribute in the Web.config file. -``` +```xml @@ -436,7 +436,7 @@ This method is obsolete. The recommended alternative is to use the Membership AP ## Examples The following code example sets the `enableCrossAppRedirects` attribute to `true` in the Web.config file for an ASP.NET application. -``` +```xml property value by using the `name` attribute in the Web.config file. -``` +```xml property value by using the `path` attribute in the Web.config file. -``` +```xml @@ -1222,7 +1222,7 @@ This method is obsolete. Alternatively, you can use ASP.NET membership to store ## Examples The following code example sets the `requireSSL` attribute in the Web.config file. -``` +```xml @@ -61,7 +61,7 @@ You can specify authorization rules in the configuration file for your Web application or programmatically in your code. For example, the following [authorization](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/8d82143t(v=vs.100)) section from a Web.config file requires users to log on (by denying anonymous users), and then allows only users in the Administrators role to have access. -``` +```xml @@ -95,7 +95,7 @@ ## Examples The following example shows the Web.config file for an application configured to use both ASP.NET membership and ASP.NET roles and to use the to store membership and role information in a SQL Server database. Users are authenticated with forms authentication and only users in the Administrators role are allowed access to the application. -``` +```xml @@ -442,7 +442,7 @@ ## Examples The following example shows the [roleManager](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ms164660(v%3dvs.100)) element in the `system.web` section of the Web.config file for an ASP.NET application. It specifies that the application uses a instance and sets the `applicationName` attribute to `MyApplication`. -``` +```xml instance and sets the `cacheRolesInCookie` attribute to `true`. -``` +```xml instance and sets the `cookieName` attribute to .ASPROLES. -``` +```xml instance and sets the `cookiePath` attribute to /MyApplication. -``` +```xml instance and sets `cookieProtection` attribute to `Encrypted`. -``` +```xml instance and sets `cookieRequireSSL` to `true`. -``` +```xml instance and sets the property to `false`. -``` +```xml instance and sets the property to 30 minutes. -``` +```xml instance and sets the `enabled` attribute to `true`. -``` +```xml instance and sets the `maxCachedResults` attribute to 10. -``` +```xml instance as the role provider for the application. -``` +```xml diff --git a/xml/System.Web.Security/SqlRoleProvider.xml b/xml/System.Web.Security/SqlRoleProvider.xml index dbf079e3ee4..c85d764a161 100644 --- a/xml/System.Web.Security/SqlRoleProvider.xml +++ b/xml/System.Web.Security/SqlRoleProvider.xml @@ -35,7 +35,7 @@ ## Examples The following example shows the Web.config file for an ASP.NET application configured to use a object and the . The `authorization` element is configured to only allow access to authenticated users in the Administrators role. -``` +```xml @@ -250,7 +250,7 @@ ## Examples The following example shows the `roleManager` element in the `system.web` section of the Web.config file for an ASP.NET application. It specifies the application's instance and sets the property to `MyApplication`. -``` +```xml completes its authorization check. For example, the following section from a Web.config file requires users to log on (by denying anonymous users), and then allows only users in the Administrators role to have access. Users not in the Administrators role are denied. -``` +```xml @@ -44,7 +44,7 @@ ## Examples The following code example grants access to Kim and members of the Admins role, while denying it to John and all anonymous users. -``` +```xml diff --git a/xml/System.Web.Security/WindowsTokenRoleProvider.xml b/xml/System.Web.Security/WindowsTokenRoleProvider.xml index c15cdf436a0..25477fb20b4 100644 --- a/xml/System.Web.Security/WindowsTokenRoleProvider.xml +++ b/xml/System.Web.Security/WindowsTokenRoleProvider.xml @@ -29,7 +29,7 @@ ## Examples The following example shows the Web.config file for an ASP.NET application. It specifies that the application uses both Windows authentication and the class to retrieve role information for Windows users. The `authorization` element specifies that only users in the BUILTIN\Administrators group are allowed access to the application. -``` +```xml @@ -162,7 +162,7 @@ ## Examples The following example shows the `roleManager` element in the `system.web` section of the Web.config file for an ASP.NET application. It specifies the application's instance and sets the property to `MyApplication`. -``` +```xml diff --git a/xml/System.Web.SessionState/HttpSessionState.xml b/xml/System.Web.SessionState/HttpSessionState.xml index 28a37c2d920..0f1997d5eb3 100644 --- a/xml/System.Web.SessionState/HttpSessionState.xml +++ b/xml/System.Web.SessionState/HttpSessionState.xml @@ -270,7 +270,7 @@ ## Examples The following code example sets the `cookieless` session attribute to `true` in the Web.config file. For this sample application configuration, the property would return . -``` +```xml in the Web.config file. For SQL Server session mode, the `sqlConnectionString` attribute is also required. -``` +```xml property. -``` +```xml property. For this sample application configuration, the property would return . -``` +```xml diff --git a/xml/System.Web.SessionState/SessionStateUtility.xml b/xml/System.Web.SessionState/SessionStateUtility.xml index bbb0b3b931e..3c5fd3b4cf1 100644 --- a/xml/System.Web.SessionState/SessionStateUtility.xml +++ b/xml/System.Web.SessionState/SessionStateUtility.xml @@ -45,7 +45,7 @@ To use this custom session-state module in an ASP.NET application, you can replace the existing reference in the Web.config file, as shown in the following example. -``` +```xml diff --git a/xml/System.Web.UI.MobileControls/DeviceSpecificChoice.xml b/xml/System.Web.UI.MobileControls/DeviceSpecificChoice.xml index 209e0e0cb64..26de50354fb 100644 --- a/xml/System.Web.UI.MobileControls/DeviceSpecificChoice.xml +++ b/xml/System.Web.UI.MobileControls/DeviceSpecificChoice.xml @@ -231,14 +231,14 @@ ## Remarks The filter name must be the name of a method on the page, in the associated `.ascx` file, or the name of a valid device filter defined in the `` section of Web.config. If a method name is specified with the property, that method must match the following prototype. -``` +```csharp public bool methodName(System.Web.Mobile.MobileCapabilities capabilities, String optionalArgument) ``` For example, if the property was set to `myChoiceMethod`, a method with the following signature must exist. -``` +```csharp public bool myChoiceMethod(System.Web.Mobile.MobileCapabilities capabilities, String optionalArgument); ``` diff --git a/xml/System.Web.UI.WebControls/AccessDataSource.xml b/xml/System.Web.UI.WebControls/AccessDataSource.xml index 12d362e6f11..3885776d5b1 100644 --- a/xml/System.Web.UI.WebControls/AccessDataSource.xml +++ b/xml/System.Web.UI.WebControls/AccessDataSource.xml @@ -31,491 +31,491 @@ Represents a Microsoft Access database for use with data-bound controls. - class is a data source control that works with Microsoft Access databases. Like its base class, , the control uses SQL queries to perform data retrieval. - - One of the unique characteristics of the control is that you do not set the property. All you need to do is set the location of the Access (.mdb) file in the property and the takes care of the underlying connection to the database. You should place Access databases in the App_Data directory of the Web site and reference them by a relative path (for example, `~/App_Data/Northwind.mdb`). This location offers additional security for data files, because they are not served if they are requested directly by the client Web browser. - - The class does not support connecting to Access databases that are protected by a user name or password, because you cannot set the property. If your Access database is protected by a user name or password, use the control to connect to it so that you can specify a complete connection string. - - You bind data-bound controls to an using the `DataSourceID` property of the data-bound control. For more information about binding a data-bound control to data source controls, see [Binding to Data Using a Data Source Control](https://msdn.microsoft.com/library/e41adfff-8fb8-449e-9cd1-9bd49788c5f7). - - Because the control is specific to only one database product, it always uses the same provider - the .NET data provider. For this reason, the property is read-only. When using the provider, the order of the parameters in a parameterized SQL statement is significant; any parameterized SQL queries that you specify in the , , , and properties must match the order of any objects that are in the corresponding parameter collection. If no parameter collection is specified on the , the order of parameters that are supplied to these operations must match the order in which they appear in the underlying SQL statement. For more information, see [Using Parameters with the SqlDataSource Control](https://learn.microsoft.com/previous-versions/aspnet/z72eefad(v=vs.100)). - - The control supports the same caching behavior that its base class supports. Use caching to increase the performance of pages that use the control. For more information about data source caching, see [Caching Data Using Data Source Controls](https://msdn.microsoft.com/library/8f534a06-3136-4048-bb2e-6563a8238d15). - - The following table describes the features of the control. - -|Capability|Requirements| -|----------------|------------------| -|Sorting|Set the property to the value.| -|Filtering|Set the property to a filtering expression used to filter the data when the method is called.| -|Paging|The does not support direct paging operations on an Access database. A data-bound control, such as the , can page over the items returned by the , if the property is set to the value.| -|Updating|Set the property to a SQL statement used to update data. This statement is typically parameterized.| -|Deleting|Set the property to a SQL statement used to delete data. This statement is typically parameterized.| -|Inserting|Set the property to a SQL statement used to insert data. This statement is typically parameterized.| -|Caching|Set the property to the value, the property to `true`, and the and properties according to the caching behavior you want for your cached data.| - - As with all data source controls, the control is associated with a strongly typed data source view class. Just as the control extends the control, the class extends the class. The class overrides a few of the methods to use the .NET data provider. - - There is no visual rendering of the control; it is implemented as a control to enable declarative persistence and to permit, optionally, participation in state management. As a result, you cannot set properties that support visual features, such as the and properties. - - -## Declarative Syntax - -``` - -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         - -``` - - - -## Examples - The following code example demonstrates a common display and update scenario with the control. The property is set to an appropriate SQL query, and data from the Northwind database is displayed in the control. Because a property is also specified and the property is set to `true`, you can edit and update the records with no additional code. The control handles adding parameters to the collection; the control passes the parameter values for the objects first, followed by the values of fields that are specified by the property. The calls the method automatically. If you want to order the parameters, explicitly, specify an collection on the . - + class is a data source control that works with Microsoft Access databases. Like its base class, , the control uses SQL queries to perform data retrieval. + + One of the unique characteristics of the control is that you do not set the property. All you need to do is set the location of the Access (.mdb) file in the property and the takes care of the underlying connection to the database. You should place Access databases in the App_Data directory of the Web site and reference them by a relative path (for example, `~/App_Data/Northwind.mdb`). This location offers additional security for data files, because they are not served if they are requested directly by the client Web browser. + + The class does not support connecting to Access databases that are protected by a user name or password, because you cannot set the property. If your Access database is protected by a user name or password, use the control to connect to it so that you can specify a complete connection string. + + You bind data-bound controls to an using the `DataSourceID` property of the data-bound control. For more information about binding a data-bound control to data source controls, see [Binding to Data Using a Data Source Control](https://msdn.microsoft.com/library/e41adfff-8fb8-449e-9cd1-9bd49788c5f7). + + Because the control is specific to only one database product, it always uses the same provider - the .NET data provider. For this reason, the property is read-only. When using the provider, the order of the parameters in a parameterized SQL statement is significant; any parameterized SQL queries that you specify in the , , , and properties must match the order of any objects that are in the corresponding parameter collection. If no parameter collection is specified on the , the order of parameters that are supplied to these operations must match the order in which they appear in the underlying SQL statement. For more information, see [Using Parameters with the SqlDataSource Control](https://learn.microsoft.com/previous-versions/aspnet/z72eefad(v=vs.100)). + + The control supports the same caching behavior that its base class supports. Use caching to increase the performance of pages that use the control. For more information about data source caching, see [Caching Data Using Data Source Controls](https://msdn.microsoft.com/library/8f534a06-3136-4048-bb2e-6563a8238d15). + + The following table describes the features of the control. + +|Capability|Requirements| +|----------------|------------------| +|Sorting|Set the property to the value.| +|Filtering|Set the property to a filtering expression used to filter the data when the method is called.| +|Paging|The does not support direct paging operations on an Access database. A data-bound control, such as the , can page over the items returned by the , if the property is set to the value.| +|Updating|Set the property to a SQL statement used to update data. This statement is typically parameterized.| +|Deleting|Set the property to a SQL statement used to delete data. This statement is typically parameterized.| +|Inserting|Set the property to a SQL statement used to insert data. This statement is typically parameterized.| +|Caching|Set the property to the value, the property to `true`, and the and properties according to the caching behavior you want for your cached data.| + + As with all data source controls, the control is associated with a strongly typed data source view class. Just as the control extends the control, the class extends the class. The class overrides a few of the methods to use the .NET data provider. + + There is no visual rendering of the control; it is implemented as a control to enable declarative persistence and to permit, optionally, participation in state management. As a result, you cannot set properties that support visual features, such as the and properties. + + +## Declarative Syntax + +```xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +``` + + + +## Examples + The following code example demonstrates a common display and update scenario with the control. The property is set to an appropriate SQL query, and data from the Northwind database is displayed in the control. Because a property is also specified and the property is set to `true`, you can edit and update the records with no additional code. The control handles adding parameters to the collection; the control passes the parameter values for the objects first, followed by the values of fields that are specified by the property. The calls the method automatically. If you want to order the parameters, explicitly, specify an collection on the . + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_5access/CS/access5cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_5access/VB/access5vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_5access/VB/access5vb.aspx" id="Snippet1"::: + ]]> @@ -556,14 +556,14 @@ Initializes a new instance of the class. - constructor to create a new data source control and bind a control to data in a Microsoft Access database. - + constructor to create a new data source control and bind a control to data in a Microsoft Access database. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_6access/CS/access6cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_6access/VB/access6vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_6access/VB/access6vb.aspx" id="Snippet1"::: + ]]> Data Source Web Server Controls @@ -591,14 +591,14 @@ The SQL query used to retrieve data from the Access database. If the SQL query is a parameterized SQL string, add objects to the collection. Initializes a new instance of the class with the specified data file path and **Select** command. - constructor to create a new data source control and bind a control to data in a Microsoft Access database. - + constructor to create a new data source control and bind a control to data in a Microsoft Access database. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_7access/CS/access7cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_7access/VB/access7vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_7access/VB/access7vb.aspx" id="Snippet1"::: + ]]> @@ -639,19 +639,19 @@ Gets the connection string that is used to connect to the Microsoft Access database. The OLE DB connection string that the control uses to connect to an Access database, through the .NET data provider. - control can be used only with the .NET data provider, and the connection string that uses is specific to this provider. Therefore, the control exposes connection string settings, such as the property, as a property and constructs a connection string at run time using the values of the property, if set. - - - -## Examples - The following code example demonstrates how to display the property of the control in an ASP.NET Web page. - + control can be used only with the .NET data provider, and the connection string that uses is specific to this provider. Therefore, the control exposes connection string settings, such as the property, as a property and constructs a connection string at run time using the values of the property, if set. + + + +## Examples + The following code example demonstrates how to display the property of the control in an ASP.NET Web page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_24access/CS/access24cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_24access/VB/access24vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_24access/VB/access24vb.aspx" id="Snippet1"::: + ]]> An attempt was made to set the property. @@ -683,11 +683,11 @@ Creates a data source view object that is associated with the data source control. An object that is associated with the instance. - class can override the method to return strongly typed data source view objects. - + class can override the method to return strongly typed data source view objects. + ]]> @@ -733,43 +733,43 @@ Gets or sets the location of the Microsoft Access .mdb file. The location of the Access .mdb file. Absolute, relative, and virtual paths are supported. - property is a virtual, absolute, or UNC directory path to the Access .mdb file that the control represents. If only the name of the file is entered, this indicates that the .mdb file is found in the same directory as the currently executing Web Forms page or code. Relative paths with both forward and backward slashes are supported. For example, `"./test/test/Northwind.mdb"` maps to the same path as `".\test\test\Northwind.mdb"` and `"test/test/Northwind.mdb"`. UNC paths, such as `"\\mymachine\somedatadirectory\Northwind.mdb"`, are also supported. Although absolute physical paths are supported, you should avoid using them because they can complicate deployment. - -## Configuring Permissions for an Access Database - An important aspect of working with an Access .mdb file is to configure permissions properly. When a Web application uses an Access database, the application must have Read permission to the .mdb file so that it can access the data. In addition, the application must have Write permission to the folder containing the .mdb file. Write permission is required because Access creates an additional file with the extension .ldb in which it maintains information about database locks for concurrent users. The .ldb file is created at run time. - - By default, ASP.NET Web applications run in the context of a local machine account called ASPNET (for Microsoft Windows 2000 and Microsoft Windows XP), or in the context of the NETWORK SERVICE account (for Microsoft Windows Server 2003). For example, for Windows 2000 or Windows XP, if the Web server is named MyServer, ASP.NET applications on the MyServer computer run in the context of the local account MyServer\ASPNET. - - Therefore, to use an Access database in an ASP.NET Web application, you must configure the folder containing the Access database to have both Read and Write permissions. - - When you create a Web site in the Microsoft Visual Web Developer Web development tool, Visual Web Developer creates a folder named App_Data below the current root folder. The folder is designed to be a store for application data, including Access databases. The App_Data folder is also used by ASP.NET to store databases that the system maintains, such as the database for membership and roles. When Visual Web Developer creates the App_Data folder, it grants Read and Write permissions for the folder to the ASPNET or NETWORK SERVICE user account. - + property is a virtual, absolute, or UNC directory path to the Access .mdb file that the control represents. If only the name of the file is entered, this indicates that the .mdb file is found in the same directory as the currently executing Web Forms page or code. Relative paths with both forward and backward slashes are supported. For example, `"./test/test/Northwind.mdb"` maps to the same path as `".\test\test\Northwind.mdb"` and `"test/test/Northwind.mdb"`. UNC paths, such as `"\\mymachine\somedatadirectory\Northwind.mdb"`, are also supported. Although absolute physical paths are supported, you should avoid using them because they can complicate deployment. + +## Configuring Permissions for an Access Database + An important aspect of working with an Access .mdb file is to configure permissions properly. When a Web application uses an Access database, the application must have Read permission to the .mdb file so that it can access the data. In addition, the application must have Write permission to the folder containing the .mdb file. Write permission is required because Access creates an additional file with the extension .ldb in which it maintains information about database locks for concurrent users. The .ldb file is created at run time. + + By default, ASP.NET Web applications run in the context of a local machine account called ASPNET (for Microsoft Windows 2000 and Microsoft Windows XP), or in the context of the NETWORK SERVICE account (for Microsoft Windows Server 2003). For example, for Windows 2000 or Windows XP, if the Web server is named MyServer, ASP.NET applications on the MyServer computer run in the context of the local account MyServer\ASPNET. + + Therefore, to use an Access database in an ASP.NET Web application, you must configure the folder containing the Access database to have both Read and Write permissions. + + When you create a Web site in the Microsoft Visual Web Developer Web development tool, Visual Web Developer creates a folder named App_Data below the current root folder. The folder is designed to be a store for application data, including Access databases. The App_Data folder is also used by ASP.NET to store databases that the system maintains, such as the database for membership and roles. When Visual Web Developer creates the App_Data folder, it grants Read and Write permissions for the folder to the ASPNET or NETWORK SERVICE user account. + > [!NOTE] -> As a security measure, Visual Web Developer also configures the App_Data folder so that files in the folder are not served by the Web server. Do not store any Web pages in the App_Data folder, because users will see an error if they request a page from that folder. - - - -## Examples - This section contains three code examples. The first code example demonstrates how to set the property to a Northwind.mdb file that resides in the same directory as the Web Forms page. The second code example demonstrates how to set the property to the virtual path of a Northwind.mdb file that resides in a directory named Database, which is beneath the directory that the Web Forms page is in. The third code example demonstrates how to set the property to a UNC path of a Northwind.mdb file that is available on a UNC share. - - The following code example demonstrates how to set the property to a Northwind.mdb file that resides in the same directory as the Web Forms page. - +> As a security measure, Visual Web Developer also configures the App_Data folder so that files in the folder are not served by the Web server. Do not store any Web pages in the App_Data folder, because users will see an error if they request a page from that folder. + + + +## Examples + This section contains three code examples. The first code example demonstrates how to set the property to a Northwind.mdb file that resides in the same directory as the Web Forms page. The second code example demonstrates how to set the property to the virtual path of a Northwind.mdb file that resides in a directory named Database, which is beneath the directory that the Web Forms page is in. The third code example demonstrates how to set the property to a UNC path of a Northwind.mdb file that is available on a UNC share. + + The following code example demonstrates how to set the property to a Northwind.mdb file that resides in the same directory as the Web Forms page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_4access/CS/access4cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_4access/VB/access4vb.aspx" id="Snippet1"::: - - The following code example demonstrates how to set the property to the virtual path of a Northwind.mdb file that resides in a directory named Database, which is beneath the directory that the Web Forms page is in. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_4access/VB/access4vb.aspx" id="Snippet1"::: + + The following code example demonstrates how to set the property to the virtual path of a Northwind.mdb file that resides in a directory named Database, which is beneath the directory that the Web Forms page is in. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_23access/CS/access23cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_23access/VB/access23vb.aspx" id="Snippet1"::: - - The following code example demonstrates how to set the property to a UNC path of a Northwind.mdb file that is available on a UNC share. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_23access/VB/access23vb.aspx" id="Snippet1"::: + + The following code example demonstrates how to set the property to a UNC path of a Northwind.mdb file that is available on a UNC share. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_22access/CS/access22cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_22access/VB/access22vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_22access/VB/access22vb.aspx" id="Snippet1"::: + ]]> An invalid path was given. @@ -832,19 +832,19 @@ Gets the name of the .NET data provider that the control uses to connect to a Microsoft Access database. The string "System.Data.OleDb". - control exposes the property because it is inherited from its base class, attempting to set the property results in a exception. - - - -## Examples - The following code example demonstrates how to display the property of the control in a Web Forms page. - + control exposes the property because it is inherited from its base class, attempting to set the property results in a exception. + + + +## Examples + The following code example demonstrates how to display the property of the control in a Web Forms page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_25access/CS/access25cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_25access/VB/access25vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AccessDataSource_25access/VB/access25vb.aspx" id="Snippet1"::: + ]]> An attempt was made to set the property. @@ -883,11 +883,11 @@ The property overrides the property. Throws a , in all cases. - , the property gets or sets a semicolon-delimited string that indicates which databases and tables to use for the Microsoft SQL Server cache dependency. Cache dependency is not supported by Microsoft Access, and any access to the property results in a exception. - + , the property gets or sets a semicolon-delimited string that indicates which databases and tables to use for the Microsoft SQL Server cache dependency. Cache dependency is not supported by Microsoft Access, and any access to the property results in a exception. + ]]> An attempt was made to get or set the property. diff --git a/xml/System.Web.UI.WebControls/AdRotator.xml b/xml/System.Web.UI.WebControls/AdRotator.xml index a7a2c50421c..93820dbd9f5 100644 --- a/xml/System.Web.UI.WebControls/AdRotator.xml +++ b/xml/System.Web.UI.WebControls/AdRotator.xml @@ -54,156 +54,156 @@ Displays an advertisement banner on a Web page. - -## Introduction - Use the control to display a randomly selected advertisement banner on the Web page. The displayed advertisement changes whenever the page refreshes. - - Advertisement information is stored in a separate XML file. The XML file allows you to maintain a list of advertisements and their associated attributes. Attributes include the path to an image to display, the URL to link to when the control is clicked, the alternate text to display when the image is not available, a keyword, and the frequency of the advertisement. Information in this file is not validated by the control. To prevent ads from executing malicious scripts, you should always check the data before releasing it, or accept ad information only from trusted sources. - - To secure your advertisement file from unauthorized Internet access, do one or more of the following: - +- [Declarative Syntax](#DeclarativeSyntax) + + +## Introduction + Use the control to display a randomly selected advertisement banner on the Web page. The displayed advertisement changes whenever the page refreshes. + + Advertisement information is stored in a separate XML file. The XML file allows you to maintain a list of advertisements and their associated attributes. Attributes include the path to an image to display, the URL to link to when the control is clicked, the alternate text to display when the image is not available, a keyword, and the frequency of the advertisement. Information in this file is not validated by the control. To prevent ads from executing malicious scripts, you should always check the data before releasing it, or accept ad information only from trusted sources. + + To secure your advertisement file from unauthorized Internet access, do one or more of the following: + - Store it in the App_Data directory, which is configured to deny internet access for files of any type. -- Rename the file with an extension that is not .xml, and map the extension to the `HttpForbiddenHandler` in Web.config. For more information, see the `httpHandlers` section in your Machine.config file. - - As an alternative to an XML file as the source of data, it is possible to provide advertisement information through a callback event. This event can also be used in combination with the XML file to extend the behavior of the control, such as redirecting to another page. See the property for additional information on the file format. - +- Rename the file with an extension that is not .xml, and map the extension to the `HttpForbiddenHandler` in Web.config. For more information, see the `httpHandlers` section in your Machine.config file. + + As an alternative to an XML file as the source of data, it is possible to provide advertisement information through a callback event. This event can also be used in combination with the XML file to extend the behavior of the control, such as redirecting to another page. See the property for additional information on the file format. + > [!NOTE] -> When page caching is enabled, an control is not cached. A new advertisement is selected whenever the Web page refreshes. A new advertisement is not selected, however, if you provide an event handler for the event. - - -## XML Advertisement File Format - The control uses a separate XML advertisement file to store the advertisement information, such as the location of the image to display and the URL of the page to link to. The property of the control specifies the path to this file. - - When creating the advertisement file, opening and closing `` tags mark the beginning and the end of the file, respectively. Opening and closing `` tags delimit each advertisement. All advertisements are nested between the opening and closing `` tags. If the file contains multiple `` tags, only the first set of `` tags in the file will be parsed by the control. All other `` tags will be ignored. - - The data elements for each advertisement are nested between the opening and closing `` tags. Although certain data elements are predefined (such as and ), you can place custom elements between the `` tags. These elements will be read by the control when it parses the file. The information is then passed to the event in the dictionary property. - - The following table lists the data elements that are predefined for the XML advertisement file. - -|Element|Description| -|-------------|-----------------| -|`ImageUrl`|The absolute or relative URL to an image file (optional).| -|`NavigateUrl`|The URL of a page to link to if the user clicks the ad (optional). **Note:** If this element is not set, the `HRef` property is not rendered on the anchor tag.| -|`Height`|The height of the image, in pixels (optional).| -|`Width`|The width of the image, in pixels (optional).| -|`AlternateText`|The text display in place of the image when the image specified by the property is not available (optional).

In some browsers, this text also appears as a `ToolTip` for the advertisement.| -|`Keyword`|A category for the advertisement (for example, "computers") that you can filter by (optional).| -|`Impressions`|A number that indicates the importance of the ad in the schedule of rotation relative to the other ads in the file (optional).

The larger the number, the more often the ad is displayed. The total of all `` values in the XML file cannot exceed 2,047,999,999. If it does, the control throws a run-time exception.| - - The following example shows the format for the XML advertisement file. - +> When page caching is enabled, an control is not cached. A new advertisement is selected whenever the Web page refreshes. A new advertisement is not selected, however, if you provide an event handler for the event. + + +## XML Advertisement File Format + The control uses a separate XML advertisement file to store the advertisement information, such as the location of the image to display and the URL of the page to link to. The property of the control specifies the path to this file. + + When creating the advertisement file, opening and closing `` tags mark the beginning and the end of the file, respectively. Opening and closing `` tags delimit each advertisement. All advertisements are nested between the opening and closing `` tags. If the file contains multiple `` tags, only the first set of `` tags in the file will be parsed by the control. All other `` tags will be ignored. + + The data elements for each advertisement are nested between the opening and closing `` tags. Although certain data elements are predefined (such as and ), you can place custom elements between the `` tags. These elements will be read by the control when it parses the file. The information is then passed to the event in the dictionary property. + + The following table lists the data elements that are predefined for the XML advertisement file. + +|Element|Description| +|-------------|-----------------| +|`ImageUrl`|The absolute or relative URL to an image file (optional).| +|`NavigateUrl`|The URL of a page to link to if the user clicks the ad (optional). **Note:** If this element is not set, the `HRef` property is not rendered on the anchor tag.| +|`Height`|The height of the image, in pixels (optional).| +|`Width`|The width of the image, in pixels (optional).| +|`AlternateText`|The text display in place of the image when the image specified by the property is not available (optional).

In some browsers, this text also appears as a `ToolTip` for the advertisement.| +|`Keyword`|A category for the advertisement (for example, "computers") that you can filter by (optional).| +|`Impressions`|A number that indicates the importance of the ad in the schedule of rotation relative to the other ads in the file (optional).

The larger the number, the more often the ad is displayed. The total of all `` values in the XML file cannot exceed 2,047,999,999. If it does, the control throws a run-time exception.| + + The following example shows the format for the XML advertisement file. + ```xml - - - - URL of image to display for Advertisement #1 - - - URL of page to link to for Advertisement #1 - - - Text to show as a ToolTip for Advertisement #1 - - - Keyword used to filter for Advertisement #1 - - - Relative importance of Advertisement #1 - - - Custom Data about Advertisement #1 - - - -``` - - -## Declarative Syntax - -``` - -``` - - - -## Examples - The following code example demonstrates how to use the control to display an advertisement banner on a Web page. - + + + + URL of image to display for Advertisement #1 + + + URL of page to link to for Advertisement #1 + + + Text to show as a ToolTip for Advertisement #1 + + + Keyword used to filter for Advertisement #1 + + + Relative importance of Advertisement #1 + + + Custom Data about Advertisement #1 + + + +``` + + +## Declarative Syntax + +```xml + +``` + + + +## Examples + The following code example demonstrates how to use the control to display an advertisement banner on a Web page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example demonstrates the file format for an XML file that contains advertisement information for the previous example. For more information on the file format, see the member. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example demonstrates the file format for an XML file that contains advertisement information for the previous example. For more information on the file format, see the member. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Topic1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Topic2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Topic1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Topic2 + + +``` + ]]>
@@ -235,22 +235,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 class. The new control is then added to the collection of a control and displayed on the Web Forms page. - + class. + + + +## Examples + The following code example demonstrates how to create and initialize a new instance of the class. The new control is then added to the collection of a control and displayed on the Web Forms 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/AdRotatorCtor/CS/adrotatorctorcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdRotatorCtor/VB/adrotatorctorvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdRotatorCtor/VB/adrotatorctorvb.aspx" id="Snippet1"::: + ]]> @@ -277,62 +277,62 @@ Occurs once per round trip to the server after the creation of the control, but before the page is rendered. - property is set, this event occurs after the advertisement has been selected from the file. - - You can control how the control is displayed by modifying the arguments passed to the event handler of the event. If the property is not set, this allows you to specify the advertisement information directly, without using a separate advertisement file. If the property is set, this allows you to extend the behavior of the control, such as redirecting to another page. - + property is set, this event occurs after the advertisement has been selected from the file. + + You can control how the control is displayed by modifying the arguments passed to the event handler of the event. If the property is not set, this allows you to specify the advertisement information directly, without using a separate advertisement file. If the property is set, this allows you to extend the behavior of the control, such as redirecting to another page. + > [!NOTE] -> When page caching is enabled, an control is not cached. A new advertisement is selected whenever the Web page refreshes. A new advertisement is not selected, however, if you provide an event handler for the event. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It gets the URL associated with the advertisement, when the control is created, and displays it below the control. - +> When page caching is enabled, an control is not cached. A new advertisement is selected whenever the Web page refreshes. A new advertisement is not selected, however, if you provide an event handler for the event. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It gets the URL associated with the advertisement, when the control is created, and displays it below 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 AdCreatedEventArgs Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdCreatedEventArgs Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example demonstrates how to format the XML file that contains the advertisement information. For more information on the XML file, see the property. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdCreatedEventArgs Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example demonstrates how to format the XML file that contains the advertisement information. For more information on the XML file, see the property. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Topic1 - This is the caption for Ad#1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Topic2 - This is the caption for Ad#2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Topic1 + This is the caption for Ad#1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Topic2 + This is the caption for Ad#2 + + +``` + > [!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/AdCreatedEventHandler/CS/adcreatedeventhandlercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdCreatedEventHandler/VB/adcreatedeventhandlervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdCreatedEventHandler/VB/adcreatedeventhandlervb.aspx" id="Snippet1"::: + ]]> @@ -391,72 +391,72 @@ Gets or sets the path to an XML file that contains advertisement information. The location of an XML file containing advertisement information. The default value is an empty string (""). - property to specify the location of an XML file that contains advertisement information. The XML file must reside within the same Web site. For deployment and security purposes, it is strongly recommended that you place the file in the same Web application. It is only possible to access an XML file that is located in a different application on the same site if the application has sufficient trust. - - You can set this property to either an absolute path or a path relative to the XML file. Use a relative path to simplify deployment. If you use a relative path, that path is relative to the location of the page or user control that contains the control. - - The property is optional. An advertisement can also be programmatically set in the event. - - The XML file contains the following predefined attributes. Only the `ImageUrl` attribute is required. - -|Attribute|Description| -|---------------|-----------------| -|`ImageUrl`|The URL of the image to display.| -|`Height`|The height of the image, in pixels (optional).| -|`Width`|The width of the image, in pixels (optional).| -|`NavigateUrl`|The URL of the page to navigate to when the control is clicked.| -|`AlternateText`|The text to display if the image is unavailable. On some browsers, this text is displayed as a ToolTip.| -|`Keyword`|The category for the advertisement. This is used by the control to filter the list of advertisements for a specific category.| -|`Impressions`|A value that indicates how often an advertisement is displayed in relation to other advertisements in the XML file.| - + property to specify the location of an XML file that contains advertisement information. The XML file must reside within the same Web site. For deployment and security purposes, it is strongly recommended that you place the file in the same Web application. It is only possible to access an XML file that is located in a different application on the same site if the application has sufficient trust. + + You can set this property to either an absolute path or a path relative to the XML file. Use a relative path to simplify deployment. If you use a relative path, that path is relative to the location of the page or user control that contains the control. + + The property is optional. An advertisement can also be programmatically set in the event. + + The XML file contains the following predefined attributes. Only the `ImageUrl` attribute is required. + +|Attribute|Description| +|---------------|-----------------| +|`ImageUrl`|The URL of the image to display.| +|`Height`|The height of the image, in pixels (optional).| +|`Width`|The width of the image, in pixels (optional).| +|`NavigateUrl`|The URL of the page to navigate to when the control is clicked.| +|`AlternateText`|The text to display if the image is unavailable. On some browsers, this text is displayed as a ToolTip.| +|`Keyword`|The category for the advertisement. This is used by the control to filter the list of advertisements for a specific category.| +|`Impressions`|A value that indicates how often an advertisement is displayed in relation to other advertisements in the XML file.| + > [!NOTE] -> The `ImageUrl` and `NavigateUrl` attributes can be a full URL, a root-relative path, or a relative path. If you use a root-relative path, the path is relative to the same Web site. If you use a relative path, the path is relative to the directory that contains the advertisement file. - - You can also include custom attributes by using custom tags in the XML file. All attribute tags are parsed from the advertisement file, and the values are placed in the dictionary. You can use the dictionary to programmatically access your custom attributes. - - Information in this file is not validated by the control. To prevent ads from executing malicious scripts, you should always check the data before releasing it, or accept ad information only from trusted sources. - - To secure your advertisement file from unauthorized Internet access, do one or more of the following: - -- Store it in the Data directory, which is configured in Machine.config to deny Internet access for files of any type. +> The `ImageUrl` and `NavigateUrl` attributes can be a full URL, a root-relative path, or a relative path. If you use a root-relative path, the path is relative to the same Web site. If you use a relative path, the path is relative to the directory that contains the advertisement file. + + You can also include custom attributes by using custom tags in the XML file. All attribute tags are parsed from the advertisement file, and the values are placed in the dictionary. You can use the dictionary to programmatically access your custom attributes. + + Information in this file is not validated by the control. To prevent ads from executing malicious scripts, you should always check the data before releasing it, or accept ad information only from trusted sources. + + To secure your advertisement file from unauthorized Internet access, do one or more of the following: + +- Store it in the Data directory, which is configured in Machine.config to deny Internet access for files of any type. - Rename the file with an extension that is not .xml, and map the extension to `HttpForbiddenHandler` in Web.config. For more information, see the `httpHandlers` section in your Machine.config file. - -## Examples - The following code example demonstrates how to use the property to specify the location of the XML file that contains advertisement information. - + +## Examples + The following code example demonstrates how to use the property to specify the location of the XML file that contains advertisement information. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example shows the file format of the XML advertisement file. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example shows the file format of the XML advertisement file. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Topic1 - This is the caption for Ad#1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Topic2 - This is the caption for Ad#2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Topic1 + This is the caption for Ad#1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Topic2 + This is the caption for Ad#2 + + +``` + ]]> @@ -489,50 +489,50 @@ Gets or sets a custom data field to use in place of the attribute for an advertisement. The name that identifies the field where the alternate text for an advertisement is stored. The default value is "AlternateText." - property is used to select a custom data field to use in place of the `AlternateText` attribute for an advertisement. Like `AlternateText`, this custom field is defined in the XML file that contains advertisement information. - - - -## Examples - The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. - + property is used to select a custom data field to use in place of the `AlternateText` attribute for an advertisement. Like `AlternateText`, this custom field is defined in the XML file that contains advertisement information. + + + +## Examples + The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/CS/defaultcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: - - The following is the sample XML data for the previous example. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: + + The following is the sample XML data for the previous example. + ```xml - - - ~/Images/ad1.gif - https://learn.microsoft.com/dotnet/visual-basic/ - Visual Basic documentation - 140 - 100 - - ~/Images/mobileAd1.jpg - https://msdn.microsoft.com/mobile/ - Windows Mobile Developer Site - - - ~/Images/ad2.gif - https://learn.microsoft.com/ - Docs - 150 - 150 - - ~/Images/mobileAd2.jpg - https://msdn.microsoft.com/mobilibity/ - Windows Mobile Developer Site - - -``` - + + + ~/Images/ad1.gif + https://learn.microsoft.com/dotnet/visual-basic/ + Visual Basic documentation + 140 + 100 + + ~/Images/mobileAd1.jpg + https://msdn.microsoft.com/mobile/ + Windows Mobile Developer Site + + + ~/Images/ad2.gif + https://learn.microsoft.com/ + Docs + 150 + 150 + + ~/Images/mobileAd2.jpg + https://msdn.microsoft.com/mobilibity/ + Windows Mobile Developer Site + + +``` + ]]> @@ -624,51 +624,51 @@ Gets or sets a custom data field to use in place of the attribute for an advertisement. The name that identifies the field where the URL for the image displayed for an advertisement is stored. The default value is "ImageUrl." - property is used for selecting a custom data field used in place of the `ImageUrl` attribute for an advertisement. Like `ImageUrl`, this custom field is defined in the XML file that contains advertisement information. - - - -## Examples - The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. - + property is used for selecting a custom data field used in place of the `ImageUrl` attribute for an advertisement. Like `ImageUrl`, this custom field is defined in the XML file that contains advertisement information. + + + +## Examples + The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/CS/defaultcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: - - The following is the sample XML data for the previous example. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: + + The following is the sample XML data for the previous example. + ```xml - - - ~/Images/ad1.gif - https://learn.microsoft.com/dotnet/visual-basic/ - Visual Basic documentation - 140 - 100 - - ~/Images/mobileAd1.jpg - https://msdn.microsoft.com/mobile/ - Windows Mobile Developer Site - - - - ~/Images/ad2.gif - https://learn.microsoft.com/ - Docs - 150 - 150 - - ~/Images/mobileAd2.jpg - https://msdn.microsoft.com/mobilibity/ - Windows Mobile Developer Site - - -``` - + + + ~/Images/ad1.gif + https://learn.microsoft.com/dotnet/visual-basic/ + Visual Basic documentation + 140 + 100 + + ~/Images/mobileAd1.jpg + https://msdn.microsoft.com/mobile/ + Windows Mobile Developer Site + + + + ~/Images/ad2.gif + https://learn.microsoft.com/ + Docs + 150 + 150 + + ~/Images/mobileAd2.jpg + https://msdn.microsoft.com/mobilibity/ + Windows Mobile Developer Site + + +``` + ]]> @@ -706,54 +706,54 @@ Gets or sets a category keyword to filter for specific types of advertisements in the XML advertisement file. The keyword to filter for specific types of advertisements in the XML advertisement file. The default value is an empty string (""). - property to filter the advertisements for the specified keyword. Only advertisements containing the keyword will be selected for the control. The property can be programmatically set to match the profile of the user. - - The property is a very simple filter that searches for the specified keyword. It is not possible to specify more than one keyword in the property, nor is it possible to declare multiple keywords in the advertisement file. - + property to filter the advertisements for the specified keyword. Only advertisements containing the keyword will be selected for the control. The property can be programmatically set to match the profile of the user. + + The property is a very simple filter that searches for the specified keyword. It is not possible to specify more than one keyword in the property, nor is it possible to declare multiple keywords in the advertisement file. + > [!NOTE] -> The property needs to be set for this property to have any effect. - +> The property needs to be set for this property to have any effect. + > [!CAUTION] -> If the specified keyword is not found in the XML advertisement file, no advertisement is displayed in the control. Be sure to specify a keyword for this property with at least one match in the advertisement file. - - - -## Examples - The following code example demonstrates how to use the property to filter for game-related advertisements. - +> If the specified keyword is not found in the XML advertisement file, no advertisement is displayed in the control. Be sure to specify a keyword for this property with at least one match in the advertisement file. + + + +## Examples + The following code example demonstrates how to use the property to filter for game-related advertisements. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic AdRotator.KeywordFilter Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.KeywordFilter Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example demonstrates how to specify a keyword for each advertisement in the XML advertisement file. For more information on the file format, see the member. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.KeywordFilter Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example demonstrates how to specify a keyword for each advertisement in the XML advertisement file. For more information on the file format, see the member. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Business - This is the caption for Ad#1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Games - This is the caption for Ad#2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Business + This is the caption for Ad#1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Games + This is the caption for Ad#2 + + +``` + ]]> @@ -785,50 +785,50 @@ Gets or sets a custom data field to use in place of the attribute for an advertisement. The name that identifies the field containing the URL for the page to navigate to when the control is clicked. The default value is "NavigateUrl." - property is used to select a custom data field used in place of the `NavigateUrl` attribute for an advertisement. Like `NavigateUrl`, this custom field is defined in the XML file that contains advertisement information. - - - -## Examples - The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. - + property is used to select a custom data field used in place of the `NavigateUrl` attribute for an advertisement. Like `NavigateUrl`, this custom field is defined in the XML file that contains advertisement information. + + + +## Examples + The following code example demonstrates using the property to specify a custom data field. The , , and properties are used to dynamically select a custom field to use in place of the `NavigateUrl`, `ImageUrl`, and `AlternateText` attributes. This example uses a device filter to indicate that custom fields should be used for Wireless Application Protocol (WAP)-enabled devices. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/CS/defaultcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: - - The following is the sample XML data for the previous example. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.AdRotator.MobileExamples/VB/defaultvb.aspx" id="Snippet1"::: + + The following is the sample XML data for the previous example. + ```xml - - - ~/Images/ad1.gif - https://learn.microsoft.com/dotnet/visual-basic/ - Visual Basic documentation - 140 - 100 - - ~/Images/mobileAd1.jpg - https://msdn.microsoft.com/mobile/ - Windows Mobile Developer Site - - - ~/Images/ad2.gif - https://learn.microsoft.com/ - Docs - 150 - 150 - - ~/Images/mobileAd2.jpg - https://msdn.microsoft.com/mobilibity/ - Windows Mobile Developer Site - - -``` - + + + ~/Images/ad1.gif + https://learn.microsoft.com/dotnet/visual-basic/ + Visual Basic documentation + 140 + 100 + + ~/Images/mobileAd1.jpg + https://msdn.microsoft.com/mobile/ + Windows Mobile Developer Site + + + ~/Images/ad2.gif + https://learn.microsoft.com/ + Docs + 150 + 150 + + ~/Images/mobileAd2.jpg + https://msdn.microsoft.com/mobilibity/ + Windows Mobile Developer Site + + +``` + ]]> @@ -859,51 +859,51 @@ An that contains event data. Raises the event for the control. - event is raised on the server after the control is created, but before the page is rendered. If the property is set, the event is raised after an advertisement has been selected by the control. - - Raising an event invokes the event-handling method 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). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event. It gets the URL associated with the advertisement when the control is created and displays it below the control. - + event is raised on the server after the control is created, but before the page is rendered. If the property is set, the event is raised after an advertisement has been selected by the control. + + Raising an event invokes the event-handling method 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). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event. It gets the URL associated with the advertisement when the control is created and displays it below the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic AdCreatedEventArgs Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdCreatedEventArgs Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example demonstrates how to format the XML file that contains the advertisement information. For more information on the XML file, see the property. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdCreatedEventArgs Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example demonstrates how to format the XML file that contains the advertisement information. For more information on the XML file, see the property. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Topic1 - This is the caption for Ad#1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Topic2 - This is the caption for Ad#2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Topic1 + This is the caption for Ad#1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Topic2 + This is the caption for Ad#2 + + +``` + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/AdCreatedEventHandler/CS/adcreatedeventhandlercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdCreatedEventHandler/VB/adcreatedeventhandlervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/AdCreatedEventHandler/VB/adcreatedeventhandlervb.aspx" id="Snippet1"::: + ]]> @@ -967,16 +967,16 @@ An object that contains event data. Gets the advertisement information for rendering by looking up the file data or calling the user event. - method so that it always displays a border in a custom control. - + method so that it always displays a border in a custom control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomADRotatorOnPreRender/CS/customadrotatoronprerendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorOnPreRender/VB/customadrotatoronprerendervb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorOnPreRender/VB/customadrotatoronprerendervb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomADRotatorOnPreRender/CS/customadrotatoronprerender.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorOnPreRender/VB/customadrotatoronprerender.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorOnPreRender/VB/customadrotatoronprerender.vb" id="Snippet2"::: + ]]> @@ -1005,13 +1005,13 @@ An object that represents the data source; the object must implement the interface. Binds the specified data source to the control. - method is called by the base class methods to bind the advertisement data from a data source to the control. - + method is called by the base class methods to bind the advertisement data from a data source to the control. + ]]> @@ -1038,15 +1038,15 @@ Retrieves the advertisement data from the associated data source. - method for an object retrieves the advertisement data from the , and then calls the and methods. - - If the property is not set, then the method calls the method of the base class. - + method for an object retrieves the advertisement data from the , and then calls the and methods. + + If the property is not set, then the method calls the method of the base class. + ]]> @@ -1079,21 +1079,21 @@ A that contains the output stream to render on the client. Displays the control on the client. - . - - - -## Examples - The following code example demonstrates how to override the method in a custom server control so that the displays a random advertisement, from an XML file, with a link and an image. - + . + + + +## Examples + The following code example demonstrates how to override the method in a custom server control so that the displays a random advertisement, from an XML file, with a link and an image. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomADRotatorRender0/CS/customadrotatorcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorRender0/VB/customadrotatorvb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorRender0/VB/customadrotatorvb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomADRotatorRender0/CS/customadrotator.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorRender0/VB/customadrotator.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomADRotatorRender0/VB/customadrotator.vb" id="Snippet2"::: + ]]> @@ -1120,13 +1120,13 @@ Gets the HTML tag for the control. An enumeration value representing the HTML tag for an control. - property to determine the value associated with an control. This property overrides the base implementation to always return . - + property to determine the value associated with an control. This property overrides the base implementation to always return . + ]]> @@ -1166,62 +1166,62 @@ Gets or sets the name of the browser window or frame that displays the contents of the Web page linked to when the control is clicked. The browser window or frame that displays the contents of the Web page linked to when the control is clicked. The default value is an empty string (""), which refreshes the window or frame with focus. - property to specify the target window or frame that displays the contents of the Web page linked to when the control is clicked. - + property to specify the target window or frame that displays the contents of the Web page linked to when the control is clicked. + > [!NOTE] -> The property renders as a `target` attribute. The `target` attribute on anchor (`a`) elements is not allowed in XHTML 1.1. Therefore, if rendered markup must conform to XHTML standards or must conform to accessibility standards, do not set the property. For more information, see [XHTML Standards in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/aspnet/exc57y7e(v=vs.100)) and [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)). - - The value must begin with a letter in the range of A to Z (case-insensitive), except for the following special values, which begin with an underscore. - -|Target value|Description| -|------------------|-----------------| -|`_blank`|Renders the content in a new window without frames.| -|`_parent`|Renders the content in the immediate frameset parent.| -|`_search`|Renders the content in the search pane.| -|`_self`|Renders the content in the frame with focus.| -|`_top`|Renders the content in the full window without frames.| - +> The property renders as a `target` attribute. The `target` attribute on anchor (`a`) elements is not allowed in XHTML 1.1. Therefore, if rendered markup must conform to XHTML standards or must conform to accessibility standards, do not set the property. For more information, see [XHTML Standards in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/aspnet/exc57y7e(v=vs.100)) and [Accessibility in Visual Studio and ASP.NET](https://learn.microsoft.com/previous-versions/ms228004(v=vs.140)). + + The value must begin with a letter in the range of A to Z (case-insensitive), except for the following special values, which begin with an underscore. + +|Target value|Description| +|------------------|-----------------| +|`_blank`|Renders the content in a new window without frames.| +|`_parent`|Renders the content in the immediate frameset parent.| +|`_search`|Renders the content in the search pane.| +|`_self`|Renders the content in the frame with focus.| +|`_top`|Renders the content in the full window without frames.| + > [!NOTE] -> Check your browser documentation to determine whether the `_search` value is supported. For example, Internet Explorer 5.0 or later supports the `_search` target value. - - - -## Examples - The following code example demonstrates how to use the property. It displays the contents of the Web page linked to when the control is clicked in a new, unframed window. - +> Check your browser documentation to determine whether the `_search` value is supported. For example, Internet Explorer 5.0 or later supports the `_search` target value. + + + +## Examples + The following code example demonstrates how to use the property. It displays the contents of the Web page linked to when the control is clicked in a new, unframed window. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following code example demonstrates the file format for an XML file that contains advertisement information. For more information on the file format, see the member. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic AdRotator.AdvertisementFile Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following code example demonstrates the file format for an XML file that contains advertisement information. For more information on the file format, see the member. + ```xml - - - ~/Images/image1.jpg - 60 - 190 - http://www.microsoft.com - Microsoft Main Site - 80 - Topic1 - This is the caption for Ad#1 - - - ~/Images/image2.jpg - 90 - 90 - http://www.wingtiptoys.com - Wingtip Toys - 80 - Topic2 - This is the caption for Ad#2 - - -``` - + + + ~/Images/image1.jpg + 60 + 190 + http://www.microsoft.com + Microsoft Main Site + 80 + Topic1 + This is the caption for Ad#1 + + + ~/Images/image2.jpg + 90 + 90 + http://www.wingtiptoys.com + Wingtip Toys + 80 + Topic2 + This is the caption for Ad#2 + + +``` + ]]> @@ -1247,11 +1247,11 @@ Gets the unique, hierarchically qualified identifier for the control. The fully qualified identifier for the server control. - property in that the property includes the identifier for the server control's naming container. This identifier is generated automatically when a page request is processed. - + property in that the property includes the identifier for the server control's naming container. This identifier is generated automatically when a page request is processed. + ]]> diff --git a/xml/System.Web.UI.WebControls/BulletedList.xml b/xml/System.Web.UI.WebControls/BulletedList.xml index 5fc1407c44a..7c561616010 100644 --- a/xml/System.Web.UI.WebControls/BulletedList.xml +++ b/xml/System.Web.UI.WebControls/BulletedList.xml @@ -90,69 +90,69 @@ ## Declarative Syntax -``` +```xml -             + ``` diff --git a/xml/System.Web.UI.WebControls/Button.xml b/xml/System.Web.UI.WebControls/Button.xml index 916c2f22d5a..bd8b862d39f 100644 --- a/xml/System.Web.UI.WebControls/Button.xml +++ b/xml/System.Web.UI.WebControls/Button.xml @@ -162,52 +162,52 @@ ## Declarative Syntax -``` +```xml ``` @@ -900,7 +900,7 @@ > [!IMPORTANT] > When performing a cross-page postback with controls with server-side validation, you should check that the page's property is `true` before processing the postback. In the case of a cross-page postback, the page to check is the . The following VB code shows how this is done: -``` +```vb Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.PreviousPage.IsValid Then ' Handle the post back diff --git a/xml/System.Web.UI.WebControls/Calendar.xml b/xml/System.Web.UI.WebControls/Calendar.xml index c88aa685090..ca613533954 100644 --- a/xml/System.Web.UI.WebControls/Calendar.xml +++ b/xml/System.Web.UI.WebControls/Calendar.xml @@ -64,144 +64,144 @@ Displays a single-month calendar that enables the user to select dates and move to the next or previous month. - -## Introduction - Use the control to display a single month of a calendar on a Web page. The control allows you to select dates and move to the next or previous month. The control supports all the types in the namespace. Apart from the Gregorian calendar, this also includes calendars that use different year and month systems, such as the Hijri calendar. - - You can specify whether the control allows you to select a single day, week, or entire month by setting the property. - - By default, the control displays the days of the month, day headings for the days of the week, a title with the month name and year, links for selecting individual days of the month, and links for moving to the next and previous month. You can customize the appearance of the control by setting the properties that control the style for different parts of the control. The following table lists the properties that specify the style for the different parts of the control. - -|Property|Description| -|--------------|-----------------| -||Specifies the style for the section that displays the days of the week.| -||Specifies the style for the dates in the displayed month.| -||Specifies the style for the navigation controls in the title section.| -||Specifies the style for the dates that are not in the currently displayed month.| -||Specifies the style for the selected dates on the calendar.| -||Specifies the style for the week and month date-selection column.| -||Specifies the style for the title section.| -||Specifies the style for today's date.| -||Specifies the style for the weekend dates.| - - 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 section that displays the days of the week.| -||Shows or hides the gridlines between the days of the month.| -||Shows or hides the navigation controls to the next or previous month.| -||Shows or hides the title section.| - - Although binding to a data source is not supported for the control, you can modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell as it is created by providing code in the event handler for the event. For more information on customizing the contents of a date cell, see . - + +## Introduction + Use the control to display a single month of a calendar on a Web page. The control allows you to select dates and move to the next or previous month. The control supports all the types in the namespace. Apart from the Gregorian calendar, this also includes calendars that use different year and month systems, such as the Hijri calendar. + + You can specify whether the control allows you to select a single day, week, or entire month by setting the property. + + By default, the control displays the days of the month, day headings for the days of the week, a title with the month name and year, links for selecting individual days of the month, and links for moving to the next and previous month. You can customize the appearance of the control by setting the properties that control the style for different parts of the control. The following table lists the properties that specify the style for the different parts of the control. + +|Property|Description| +|--------------|-----------------| +||Specifies the style for the section that displays the days of the week.| +||Specifies the style for the dates in the displayed month.| +||Specifies the style for the navigation controls in the title section.| +||Specifies the style for the dates that are not in the currently displayed month.| +||Specifies the style for the selected dates on the calendar.| +||Specifies the style for the week and month date-selection column.| +||Specifies the style for the title section.| +||Specifies the style for today's date.| +||Specifies the style for the weekend dates.| + + 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 section that displays the days of the week.| +||Shows or hides the gridlines between the days of the month.| +||Shows or hides the navigation controls to the next or previous month.| +||Shows or hides the title section.| + + Although binding to a data source is not supported for the control, you can modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell as it is created by providing code in the event handler for the event. For more information on customizing the contents of a date cell, see . + > [!NOTE] -> The control renders ECMAScript (JScript, JavaScript) to the client browser. The client browser must have ECMAScript enabled for this control to function properly. For more information on client script, see [Client Script in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/3hc29e2a(v=vs.100)). - - -## Accessibility - The markup rendered by default for this control might not conform to accessibility standards. For details about accessibility support for this control, see [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 create a control on a Web page. - +> The control renders ECMAScript (JScript, JavaScript) to the client browser. The client browser must have ECMAScript enabled for this control to function properly. For more information on client script, see [Client Script in ASP.NET Web Pages](https://learn.microsoft.com/previous-versions/aspnet/3hc29e2a(v=vs.100)). + + +## Accessibility + The markup rendered by default for this control might not conform to accessibility standards. For details about accessibility support for this control, see [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). + + +## Declarative Syntax + +```xml + + + + + + + + + + + +``` + + + +## Examples + The following code example demonstrates how to create a control on a Web page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar Example/VB/sourcevb.aspx" id="Snippet1"::: - - The following example shows a control used when editing one of the columns displayed by a control. The control is bound to the data source with the `Bind` method. The `Eval` method is used to bind the date value that is displayed by the control. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar Example/VB/sourcevb.aspx" id="Snippet1"::: + + The following example shows a control used when editing one of the columns displayed by a control. The control is bound to the data source with the `Bind` method. The `Eval` method is used to bind the date value that is displayed by the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/GridViewConcepts/CS/gridviewcustomcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/GridViewConcepts/VB/gridviewcustomvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/GridViewConcepts/VB/gridviewcustomvb.aspx" id="Snippet1"::: + ]]> @@ -239,19 +239,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="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.Calendar Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.Calendar Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.Calendar Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -286,21 +286,21 @@ Gets or sets a text value that is rendered as a caption for the calendar. The table caption. - property to align the caption with the calendar. - - The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to display a caption for a control. - + property to align the caption with the calendar. + + The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to display a caption for a control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarCaption/CS/calendarcaptioncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCaption/VB/calendarcaptionvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCaption/VB/calendarcaptionvb.aspx" id="Snippet1"::: + ]]> @@ -332,27 +332,27 @@ Gets or sets the alignment of the text that is rendered as a caption for the calendar. A value that indicates the alignment of the caption. - control. The default value is , which lets the browser determine where to align the caption. The following table explains the relationship between the value and the appearance of the caption. - -| value|Appearance| -|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| -|`Bottom`|The caption appears at the bottom of the calendar, with the text centered.| -|`Left`|The caption appears at the top of the calendar, with the text left-aligned.| -|`NotSet`|The caption alignment is not set and is determined by the browser.| -|`Right`|The caption appears at the top of the calendar, with the text right-aligned.| -|`Top`|The caption appears at the top of the calendar with the text centered.| - - - -## Examples - The following code example demonstrates how to use the property to align a caption for a control. - + control. The default value is , which lets the browser determine where to align the caption. The following table explains the relationship between the value and the appearance of the caption. + +| value|Appearance| +|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +|`Bottom`|The caption appears at the bottom of the calendar, with the text centered.| +|`Left`|The caption appears at the top of the calendar, with the text left-aligned.| +|`NotSet`|The caption alignment is not set and is determined by the browser.| +|`Right`|The caption appears at the top of the calendar, with the text right-aligned.| +|`Top`|The caption appears at the top of the calendar with the text centered.| + + + +## Examples + The following code example demonstrates how to use the property to align a caption for a control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarCaption/CS/calendarcaptioncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCaption/VB/calendarcaptionvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCaption/VB/calendarcaptionvb.aspx" id="Snippet1"::: + ]]> The value specified is not one of the values. @@ -390,25 +390,25 @@ Gets or sets the amount of space between the contents of a cell and the cell's border. The amount of space (in pixels) between the contents of a cell and the cell's border. The default value is . - [!NOTE] -> Setting this property to `-1` indicates that this property is not set in the rendered table. - - - -## Examples - The following code example demonstrates how to use the property to pad each cell with 5 pixels. - +> Setting this property to `-1` indicates that this property is not set in the rendered table. + + + +## Examples + The following code example demonstrates how to use the property to pad each cell with 5 pixels. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.CellPadding Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.CellPadding Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarCellPadding/CS/calendarcellpaddingcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCellPadding/VB/calendarcellpaddingvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCellPadding/VB/calendarcellpaddingvb.aspx" id="Snippet1"::: + ]]> The specified cell padding is less than -1. @@ -446,25 +446,25 @@ Gets or sets the amount of space between cells. The amount of space (in pixels) between cells. The default value is . - [!NOTE] -> Setting this property to `-1` indicates that this property is not set in the rendered table. - - - -## Examples - The following code example demonstrates how to use the property to space the cells 5 pixels apart. - +> Setting this property to `-1` indicates that this property is not set in the rendered table. + + + +## Examples + The following code example demonstrates how to use the property to space the cells 5 pixels apart. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.CellSpacing Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.CellSpacing Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.CellSpacing Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarCellPadding/CS/calendarcellpaddingcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCellPadding/VB/calendarcellpaddingvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarCellPadding/VB/calendarcellpaddingvb.aspx" id="Snippet1"::: + ]]> The specified cell spacing is less than -1. @@ -493,22 +493,22 @@ Creates a collection to store child controls. Always returns an object. - method is primarily of interest to control developers who extend the functionality of the Calendar control. - - - -## 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 primarily of interest to control developers who extend the functionality of the Calendar control. + + + +## 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/CustomCalendarCreateControlCollection/CS/custom_calendar_createcontrolcollectioncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarCreateControlCollection/VB/custom_calendar_createcontrolcollectionvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarCreateControlCollection/VB/custom_calendar_createcontrolcollectionvb.aspx" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarCreateControlCollection/CS/custom_calendar_createcontrolcollection.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarCreateControlCollection/VB/custom_calendar_createcontrolcollection.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarCreateControlCollection/VB/custom_calendar_createcontrolcollection.vb" id="Snippet2"::: + ]]> @@ -548,27 +548,27 @@ Gets the style properties for the section that displays the day of the week. A that contains the style properties for the section that displays the day of the week. The default value is an empty . - . - + . + > [!NOTE] -> The name format for the days of the week is controlled by the property. - - This property applies only when the property is set to `true`. - - - -## Examples - The following code example demonstrates how to use the property to specify a bold font for the section that displays the days of the week. - +> The name format for the days of the week is controlled by the property. + + This property applies only when the property is set to `true`. + + + +## Examples + The following code example demonstrates how to use the property to specify a bold font for the section that displays the days of the week. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.DayHeaderStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayHeaderStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayHeaderStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarDayHeaderStyle/CS/calendardayheaderstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayHeaderStyle/VB/calendardayheaderstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayHeaderStyle/VB/calendardayheaderstylevb.aspx" id="Snippet1"::: + ]]> @@ -607,26 +607,26 @@ Gets or sets the name format for days of the week. One of the values. The default value is . - property to specify the name format for the days of the week. This property is set with one of the enumeration values. You can specify whether the days of the week are displayed as the full name, short (abbreviated) name, first letter of the day, or first two letters of the day. - - This property applies only if the property is set to `true`. - - The day names are based on the server's local settings. - - - -## Examples - The following code example demonstrates how to use the property to specify that days of the week are displayed in full. - + property to specify the name format for the days of the week. This property is set with one of the enumeration values. You can specify whether the days of the week are displayed as the full name, short (abbreviated) name, first letter of the day, or first two letters of the day. + + This property applies only if the property is set to `true`. + + The day names are based on the server's local settings. + + + +## Examples + The following code example demonstrates how to use the property to specify that days of the week are displayed in full. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.DayNameFormat Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayNameFormat Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayNameFormat Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarDayNameFormat/CS/calendardaynameformatcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayNameFormat/VB/calendardaynameformatvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayNameFormat/VB/calendardaynameformatvb.aspx" id="Snippet1"::: + ]]> The specified day name format is not one of the values. @@ -654,29 +654,29 @@ Occurs when each day is created in the control hierarchy for the control. - control. - - Although data binding is not supported for the control, it is possible to modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell when it is created by providing code in the event handler for the event. For more information on customizing the contents of a date cell, see . - + control. + + Although data binding is not supported for the control, it is possible to modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell when it is created by providing code in the event handler for the event. For more information on customizing the contents of a date cell, see . + > [!NOTE] -> Because the event is raised while the control is being rendered, you cannot add a control that can also raise an event, such as . You can only add static controls, such as , , , and . - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to specify and code a handler for the event to make the background color yellow for the days in the displayed month. It also demonstrates how to customize the contents of a cell by adding a control to the cell. - +> Because the event is raised while the control is being rendered, you cannot add a control that can also raise an event, such as . You can only add static controls, such as , , , and . + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to specify and code a handler for the event to make the background color yellow for the days in the displayed month. It also demonstrates how to customize the contents of a cell by adding a control to the cell. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.DayRender Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayRender Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayRender Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarDayRender/CS/calendardayrendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayRender/VB/calendardayrendervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayRender/VB/calendardayrendervb.aspx" id="Snippet1"::: + ]]> @@ -721,27 +721,27 @@ Gets the style properties for the days in the displayed month. A that contains the style properties for the days in the displayed month. The default value is an empty . - [!NOTE] -> If you do not specify a different style for the selected date, weekend dates, dates not in the currently displayed month, or today's date, these dates will also be displayed using the style specified by the property. Use the , , , and properties to specify alternative styles for these dates. - - For more information on the different style properties that can be controlled, see . - - - -## Examples - The following code example demonstrates how to use the property to specify that the days in the currently displayed month are shown in gray. - +> If you do not specify a different style for the selected date, weekend dates, dates not in the currently displayed month, or today's date, these dates will also be displayed using the style specified by the property. Use the , , , and properties to specify alternative styles for these dates. + + For more information on the different style properties that can be controlled, see . + + + +## Examples + The following code example demonstrates how to use the property to specify that the days in the currently displayed month are shown in gray. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.DayStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="xml" source="~/snippets/common/VS_Snippets_WebNet/Classic Calendar.DayStyle Example/Common/source.xml" id="Snippet1"::: - + :::code language="xml" source="~/snippets/common/VS_Snippets_WebNet/Classic Calendar.DayStyle Example/Common/source.xml" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarDayStyle/CS/calendardaystylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayStyle/VB/calendardaystylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayStyle/VB/calendardaystylevb.aspx" id="Snippet1"::: + ]]> @@ -781,22 +781,22 @@ Gets or sets the day of the week to display in the first day column of the control. One of the values. The default is , which indicates that the day specified in the system setting is used. - property to specify the day of the week to display in the first day column of the control. This property is set with one of the enumeration values. You can specify any day of the week or `FirstDayOfWeek.Default`, which indicates that the date is determined by the system settings. - - - -## Examples - The following code example demonstrates how to use the property to set the first day column to Monday. - + property to specify the day of the week to display in the first day column of the control. This property is set with one of the enumeration values. You can specify any day of the week or `FirstDayOfWeek.Default`, which indicates that the date is determined by the system settings. + + + +## Examples + The following code example demonstrates how to use the property to set the first day column to Monday. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.FirstDayOfWeek Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.FirstDayOfWeek Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.FirstDayOfWeek Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarFirstDayOfWeek/CS/calendarfirstdayofweekcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarFirstDayOfWeek/VB/calendarfirstdayofweekvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarFirstDayOfWeek/VB/calendarfirstdayofweekvb.aspx" id="Snippet1"::: + ]]> The date specified is not one of the values. @@ -829,22 +829,22 @@ if the contains week selectors; otherwise, . - values `DayWeek` and `DayWeekMonth` both contain week selectors. - - - -## Examples - The following code example demonstrates how to determine the value of the property in a custom control. - + values `DayWeek` and `DayWeekMonth` both contain week selectors. + + + +## Examples + The following code example demonstrates how to determine the value of the property in a custom control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/CS/custom_calendar_hasweekselectorscs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/VB/custom_calendar_hasweekselectorsvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/VB/custom_calendar_hasweekselectorsvb.aspx" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/CS/custom_calendar_hasweekselectors.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/VB/custom_calendar_hasweekselectors.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarHasWeekSelectors/VB/custom_calendar_hasweekselectors.vb" id="Snippet2"::: + ]]> @@ -910,28 +910,28 @@ Gets or sets the text displayed for the next month navigation control. The caption text for the next month navigation control. The default value is , which is rendered as the greater than sign (>). - property to provide custom text for the next month navigation control. This property is commonly used along with the property to provide a custom set of navigation controls. - + property to provide custom text for the next month navigation control. This property is commonly used along with the property to provide a custom set of navigation controls. + > [!NOTE] -> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. - - Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. - - This property applies only if the property is set to `true`. - - The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to specify custom text for the navigation control to the next month. - +> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. + + Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. + + This property applies only if the property is set to `true`. + + The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to specify custom text for the navigation control to the next month. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -969,26 +969,26 @@ Gets or sets the format of the next and previous month navigation elements in the title section of the control. One of the values. The default value is . - property to specify the format for the next and previous month navigation elements on the control. This property is set with one of the enumeration values. You can specify whether the text for the navigation controls is displayed as the full month name, the short (abbreviated) month name, or custom text. - - To specify custom navigation text, set this property to `NextPrevFormat.CustomText` and set the and properties to the custom text. - - This property applies only if the property is set to `true`. - - - -## Examples - The following code example demonstrates how to use the property to specify the short month format for the navigation controls. - + property to specify the format for the next and previous month navigation elements on the control. This property is set with one of the enumeration values. You can specify whether the text for the navigation controls is displayed as the full month name, the short (abbreviated) month name, or custom text. + + To specify custom navigation text, set this property to `NextPrevFormat.CustomText` and set the and properties to the custom text. + + This property applies only if the property is set to `true`. + + + +## Examples + The following code example demonstrates how to use the property to specify the short month format for the navigation controls. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.NextPrevFormat Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextPrevFormat Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextPrevFormat Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarNextPrevFormat/CS/calendarnextprevformatcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarNextPrevFormat/VB/calendarnextprevformatvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarNextPrevFormat/VB/calendarnextprevformatvb.aspx" id="Snippet1"::: + ]]> The specified format is not one of the values. @@ -1032,24 +1032,24 @@ Gets the style properties for the next and previous month navigation elements. The style properties for the next and previous month navigation elements. The default value is an empty . - . - - This property applies only if the property is set to `true`. - - - -## Examples - The following code example demonstrates how to use the property to specify blue text for the next month and previous month navigation controls. - + . + + This property applies only if the property is set to `true`. + + + +## Examples + The following code example demonstrates how to use the property to specify blue text for the next month and previous month navigation controls. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.NextPrevStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextPrevStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextPrevStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarNextPrevStyle/CS/calendarnextprevstylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarNextPrevStyle/VB/calendarnextprevstylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarNextPrevStyle/VB/calendarnextprevstylevb.aspx" id="Snippet1"::: + ]]> @@ -1081,33 +1081,33 @@ A that contains information about the day to render. Raises the event of the control and allows you to provide a custom handler for the event. - control, it is possible to modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell when it is created by providing code in the event handler for the event. - - The event handler receives a object that contains event data. The object contains two properties that you can use to programmatically control the format of the date cell. The property represents the cell being rendered, while the property represents the date to render in the cell. - - You can also customize the contents of a cell by dynamically adding controls to the collection of the property. - + control, it is possible to modify the content and formatting of the individual date cells. Before the control is displayed on the Web page, it creates and assembles the components that make up the control. The event is raised when each date cell in the control is created. You can control the contents and formatting of a date cell when it is created by providing code in the event handler for the event. + + The event handler receives a object that contains event data. The object contains two properties that you can use to programmatically control the format of the date cell. The property represents the cell being rendered, while the property represents the date to render in the cell. + + You can also customize the contents of a cell by dynamically adding controls to the collection of the property. + > [!NOTE] -> Because the event is raised while the control is being rendered, you cannot add a control that can also raise an event, such as . You can only add static controls, such as , , , and . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 make the background color yellow for the days in the displayed month. It also demonstrates how to customize the contents of a cell by adding a control to the cell. - +> Because the event is raised while the control is being rendered, you cannot add a control that can also raise an event, such as . You can only add static controls, such as , , , and . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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 make the background color yellow for the days in the displayed month. It also demonstrates how to customize the contents of a cell by adding a control to the cell. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.DayRender Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayRender Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.DayRender Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarDayRender/CS/calendardayrendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayRender/VB/calendardayrendervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarDayRender/VB/calendardayrendervb.aspx" id="Snippet1"::: + ]]> @@ -1146,24 +1146,24 @@ An that contains event data. Raises the event. - 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 override the method so that it always displays a three-point border in a custom server control. - + 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 override the method so that it always displays a three-point border in a custom server control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarOnPreRender/CS/custom_calendar_onprerendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarOnPreRender/VB/custom_calendar_onprerendervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarOnPreRender/VB/custom_calendar_onprerendervb.aspx" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarOnPreRender/CS/custom_calendar_onprerender.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarOnPreRender/VB/custom_calendar_onprerender.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarOnPreRender/VB/custom_calendar_onprerender.vb" id="Snippet2"::: + ]]> @@ -1192,26 +1192,26 @@ Raises the event of the control and allows you to provide a custom handler for the event. - event is raised when the user selects a day, a week, or an entire month by clicking the date selector controls. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 number of items selected in the control. - + event is raised when the user selects a day, a week, or an entire month by clicking the date selector controls. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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 number of items selected in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectionChanged/CS/calendarselectionchangedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged/VB/calendarselectionchangedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged/VB/calendarselectionchangedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectionChanged2/CS/calendarselectionchanged2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged2/VB/calendarselectionchanged2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged2/VB/calendarselectionchanged2vb.aspx" id="Snippet1"::: + ]]> @@ -1246,26 +1246,26 @@ A that represents the previous month displayed by the . Raises the event of the control and allows you to provide a custom handler for the event. - event is raised when the user clicks the next or previous month navigation elements on the title section. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 whether the has moved forward or backward one month. - + event is raised when the user clicks the next or previous month navigation elements on the title section. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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 whether the has moved forward or backward one month. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarVisibleMonthChanged/CS/calendarvisiblemonthchangedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarVisibleMonthChanged/CS/calendarvisiblemonthchangedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: + ]]> @@ -1314,21 +1314,21 @@ Gets the style properties for the days on the control that are not in the displayed month. A that contains the style properties for the days on the control that are not in the displayed month. The default value is an empty . - control that are not in the displayed month. If the property is not set, the style specified in the property is used. - - For more information on the different style properties that can be controlled, see . - - - -## Examples - The following code example demonstrates how to use the property to specify a light gray foreground color for the days on the control that are not in the currently displayed month. - + control that are not in the displayed month. If the property is not set, the style specified in the property is used. + + For more information on the different style properties that can be controlled, see . + + + +## Examples + The following code example demonstrates how to use the property to specify a light gray foreground color for the days on the control that are not in the currently displayed month. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarOtherMonthDayStyle/CS/calendarothermonthdaystylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarOtherMonthDayStyle/VB/calendarothermonthdaystylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarOtherMonthDayStyle/VB/calendarothermonthdaystylevb.aspx" id="Snippet1"::: + ]]> @@ -1370,28 +1370,28 @@ Gets or sets the text displayed for the previous month navigation control. The caption text for the previous month navigation control. The default value is , which is rendered as the less than sign (<). - property to provide custom text for the previous month navigation control. This property is commonly used along with the property to provide a custom set of navigation controls. - + property to provide custom text for the previous month navigation control. This property is commonly used along with the property to provide a custom set of navigation controls. + > [!NOTE] -> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. - - Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. - - This property applies only if the property is set to `true`. - - The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to specify custom text for the previous month navigation control. - +> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. + + Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. + + This property applies only if the property is set to `true`. + + The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to specify custom text for the previous month navigation control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.NextMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1421,11 +1421,11 @@ A that represents the event argument passed to the event handler. Raises an event for the control when it posts back to the server. - control. - + control. + ]]> @@ -1458,17 +1458,17 @@ A that contains the output stream for rendering on the client. Displays the control on the client. - method in a custom server control so that the always displays an image. - + method in a custom server control so that the always displays an image. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarRender/CS/custom_calendar_rendercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarRender/VB/custom_calendar_rendervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarRender/VB/custom_calendar_rendervb.aspx" id="Snippet1"::: + :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomCalendarRender/CS/custom_calendar_render.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarRender/VB/custom_calendar_render.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomCalendarRender/VB/custom_calendar_render.vb" id="Snippet2"::: + ]]> @@ -1532,28 +1532,28 @@ Gets or sets the selected date. A that represents the selected date. The default value is DateTime.MinValue. - property to determine the selected date on the control. - - The property and the collection are closely related. When the property is set to `CalendarSelectionMode.Day`, a mode that allows only a single date selection, and `SelectedDates[0]` have the same value and `SelectedDates.Count` equals 1. When the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, modes that allows multiple date selections, and `SelectedDates[0]` have the same value. - - The property is set using a object. - - When the user selects a date on the control, the event is raised. The property is updated to the selected date. The collection is also updated to contain just this date. - + property to determine the selected date on the control. + + The property and the collection are closely related. When the property is set to `CalendarSelectionMode.Day`, a mode that allows only a single date selection, and `SelectedDates[0]` have the same value and `SelectedDates.Count` equals 1. When the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, modes that allows multiple date selections, and `SelectedDates[0]` have the same value. + + The property is set using a object. + + When the user selects a date on the control, the event is raised. The property is updated to the selected date. The collection is also updated to contain just this date. + > [!NOTE] -> Both the property and the collection are updated before the event is raised. You can override the date selection by using the event handler to manually set the property. The event does not get raised when this property is programmatically set. - - - -## Examples - The following code example demonstrates how to use the property to determine the selected date on the control. - +> Both the property and the collection are updated before the event is raised. You can override the date selection by using the event handler to manually set the property. The event does not get raised when this property is programmatically set. + + + +## Examples + The following code example demonstrates how to use the property to determine the selected date on the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectedDate Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDate Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDate Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1595,30 +1595,30 @@ Gets a collection of objects that represent the selected dates on the control. A that contains a collection of objects representing the selected dates on the . The default value is an empty . - collection to determine the currently selected dates on the control. - - The property and the collection are closely related. When the property is set to `CalendarSelectionMode.Day`, a mode that allows only a single date selection, and `SelectedDates[0]` have the same value and `SelectedDates.Count` equals 1. When the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, modes that allows multiple date selections, and `SelectedDates[0]` have the same value. - - The property stores a collection of objects. - - When the user selects a week or month on the control, the event is raised. The selected dates are added to the collection, replacing the previous contents. The range of dates are sorted in ascending order by date. The property is also updated to contain the first date in the collection. - - You can also use the collection to programmatically select dates on the control. Use the , , , and methods to programmatically manipulate the selected dates in the collection. - + collection to determine the currently selected dates on the control. + + The property and the collection are closely related. When the property is set to `CalendarSelectionMode.Day`, a mode that allows only a single date selection, and `SelectedDates[0]` have the same value and `SelectedDates.Count` equals 1. When the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, modes that allows multiple date selections, and `SelectedDates[0]` have the same value. + + The property stores a collection of objects. + + When the user selects a week or month on the control, the event is raised. The selected dates are added to the collection, replacing the previous contents. The range of dates are sorted in ascending order by date. The property is also updated to contain the first date in the collection. + + You can also use the collection to programmatically select dates on the control. Use the , , , and methods to programmatically manipulate the selected dates in the collection. + > [!NOTE] -> Both the property and the collection are updated before the event is raised. You can override the date selection by using the event handler to manually set the collection. The event is not raised when this collection is programmatically set. - - - -## Examples - The following code example demonstrates how to use the collection to determine the selected dates on the control. - +> Both the property and the collection are updated before the event is raised. You can override the date selection by using the event handler to manually set the collection. The event is not raised when this collection is programmatically set. + + + +## Examples + The following code example demonstrates how to use the collection to determine the selected dates on the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectedDates Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDates Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDates Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1668,24 +1668,24 @@ Gets the style properties for the selected dates. A that contains the style properties for the selected dates. The default value is an empty . - control. If the property is not set, the style specified in the property is used. - - For more information on the different style properties that can be controlled, see . - - - -## Examples - The following code example demonstrates how to use the property to specify a blue background color for the selected dates on the control. - + control. If the property is not set, the style specified in the property is used. + + For more information on the different style properties that can be controlled, see . + + + +## Examples + The following code example demonstrates how to use the property to specify a blue background color for the selected dates on the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectedDayStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectedDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectedDayStyle/CS/calendarselecteddaystylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectedDayStyle/VB/calendarselecteddaystylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectedDayStyle/VB/calendarselecteddaystylevb.aspx" id="Snippet1"::: + ]]> @@ -1711,24 +1711,24 @@ Occurs when the user selects a day, a week, or an entire month by clicking the date selector controls. - event to display the number of items selected in the control. - + event to display the number of items selected in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectionChanged/CS/calendarselectionchangedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged/VB/calendarselectionchangedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged/VB/calendarselectionchangedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectionChanged2/CS/calendarselectionchanged2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged2/VB/calendarselectionchanged2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionChanged2/VB/calendarselectionchanged2vb.aspx" id="Snippet1"::: + ]]> @@ -1765,26 +1765,26 @@ Gets or sets the date selection mode on the control that specifies whether the user can select a single day, a week, or an entire month. One of the values. The default value is . - property to specify the date selection mode on the control. This property is set with one of the enumeration values. You can specify whether the user can select a single day, a week, or an entire month, or you can disable date-selection capability entirely. - - When this property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, an additional selector column that contains week and month selection controls is displayed in the first column of the control. Use the property to customize the appearance of this column. - - To disable date selection, set this property to `CalendarSelectionMode.None`. - - - -## Examples - The following code example demonstrates how to use the property to allow date selection by a single day, a week, or an entire month. - + property to specify the date selection mode on the control. This property is set with one of the enumeration values. You can specify whether the user can select a single day, a week, or an entire month, or you can disable date-selection capability entirely. + + When this property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`, an additional selector column that contains week and month selection controls is displayed in the first column of the control. Use the property to customize the appearance of this column. + + To disable date selection, set this property to `CalendarSelectionMode.None`. + + + +## Examples + The following code example demonstrates how to use the property to allow date selection by a single day, a week, or an entire month. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectionMode Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectionMode Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectionMode Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarSelectionMode2/CS/calendarselectionmodecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionMode2/VB/calendarselectionmodevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarSelectionMode2/VB/calendarselectionmodevb.aspx" id="Snippet1"::: + ]]> The specified selection mode is not one of the values. @@ -1827,28 +1827,28 @@ Gets or sets the text displayed for the month selection element in the selector column. The text displayed for the month selection element in the selector column. The default value is , which is rendered as two greater than signs (>>). - property to provide custom text for the month selection element in the selector column. - + property to provide custom text for the month selection element in the selector column. + > [!NOTE] -> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. - - Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. - - This property applies only if the property is set to `CalendarSelectionMode.DayWeekMonth`. - - The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to provide custom text for the month selection element. - +> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. + + Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. + + This property applies only if the property is set to `CalendarSelectionMode.DayWeekMonth`. + + The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to provide custom text for the month selection element. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectMonthText Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectMonthText Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1889,21 +1889,21 @@ Gets the style properties for the week and month selector column. A that contains the style properties for the week and month selector column. The default value is an empty . - . - - The property applies only when the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`. - - - -## Examples - The following code example demonstrates how to use the property to specify a light gray background color for the selector column. - + . + + The property applies only when the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`. + + + +## Examples + The following code example demonstrates how to use the property to specify a light gray background color for the selector column. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectorStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectorStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectorStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -1945,28 +1945,28 @@ Gets or sets the text displayed for the week selection element in the selector column. The text displayed for the week selection element in the selector column. The default value is , which is rendered as a greater than sign (>). - property to provide custom text for the week selection element in the selector column. - + property to provide custom text for the week selection element in the selector column. + > [!NOTE] -> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. - - Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. - - This property applies only if the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`. - - The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). - - - -## Examples - The following code example demonstrates how to use the property to provide custom text for the week selection element. - +> This property does not automatically encode to HTML. You need to convert special characters to the appropriate HTML value, unless you want the characters to be treated as HTML. For example, to explicitly display the greater than symbol (>), you must use the value `>`. + + Because this property does not automatically encode to HTML, it is possible to specify an HTML tag for the property. For example, if you want to display an image for the next month navigation control, you can set this property to an expression that contains an `` element. + + This property applies only if the property is set to `CalendarSelectionMode.DayWeek` or `CalendarSelectionMode.DayWeekMonth`. + + The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see and [ASP.NET Globalization and Localization](https://learn.microsoft.com/previous-versions/aspnet/c6zyy3s9(v=vs.100)). + + + +## Examples + The following code example demonstrates how to use the property to provide custom text for the week selection element. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.SelectWeekText Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectWeekText Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.SelectWeekText Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -2004,24 +2004,24 @@ if the heading for the days of the week is displayed; otherwise, . The default is . - property to specify whether the heading for the days of the week is displayed. - - The appearance of the heading can be customized by using the property. - - - -## Examples - The following code example demonstrates how to use the property to hide the heading for the days of the week. - + property to specify whether the heading for the days of the week is displayed. + + The appearance of the heading can be customized by using the property. + + + +## Examples + The following code example demonstrates how to use the property to hide the heading for the days of the week. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.ShowDayHeader Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowDayHeader Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowDayHeader Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarShowDayHeader/CS/calendarshowdayheadercs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowDayHeader/VB/calendarshowdayheadervb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowDayHeader/VB/calendarshowdayheadervb.aspx" id="Snippet1"::: + ]]> @@ -2059,22 +2059,22 @@ if the days on the control are separated with gridlines; otherwise, . The default value is . - property to specify whether the days on the control are separated with gridlines. - - - -## Examples - The following code example demonstrates how to use the property to display the gridlines between days in the control. - + property to specify whether the days on the control are separated with gridlines. + + + +## Examples + The following code example demonstrates how to use the property to display the gridlines between days in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.ShowGridLines Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowGridLines Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowGridLines Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarShowGridLines/CS/calendarshowgridlinescs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowGridLines/VB/calendarshowgridlinesvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowGridLines/VB/calendarshowgridlinesvb.aspx" id="Snippet1"::: + ]]> @@ -2111,24 +2111,24 @@ if the displays the next and previous month navigation elements in the title section; otherwise, . The default value is . - property to specify whether the next and previous month navigation elements are displayed in the title section. - - The appearance of the next and previous month navigation controls can be customized by using the property. - - - -## Examples - The following code example demonstrates how to use the property to hide the next and previous month navigation controls in the title section. - + property to specify whether the next and previous month navigation elements are displayed in the title section. + + The appearance of the next and previous month navigation controls can be customized by using the property. + + + +## Examples + The following code example demonstrates how to use the property to hide the next and previous month navigation controls in the title section. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.ShowNextPrevMonth Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowNextPrevMonth Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.ShowNextPrevMonth Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarShowNextPrevMonth/CS/calendarshownextprevmonthcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowNextPrevMonth/VB/calendarshownextprevmonthvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowNextPrevMonth/VB/calendarshownextprevmonthvb.aspx" id="Snippet1"::: + ]]> @@ -2166,24 +2166,24 @@ if the displays the title section; otherwise, . The default value is . - property to specify whether the title section is displayed. - + property to specify whether the title section is displayed. + > [!NOTE] -> Hiding the title section also hides the next and previous month navigation controls. - - The appearance of the title section can be customized by using the property. - - - -## Examples - The following code example demonstrates how to use the property to hide the title header. - +> Hiding the title section also hides the next and previous month navigation controls. + + The appearance of the title section can be customized by using the property. + + + +## Examples + The following code example demonstrates how to use the property to hide the title header. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarShowTitle/CS/calendarshowtitlecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowTitle/VB/calendarshowtitlevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarShowTitle/VB/calendarshowtitlevb.aspx" id="Snippet1"::: + ]]> @@ -2209,11 +2209,11 @@ if the property indicates an ASP.NET version lower than 4.0; otherwise, . - . - + . + ]]> @@ -2287,24 +2287,24 @@ Gets or sets the format for the title section. One of the values. The default value is . - property to specify the format for the title section. This property is set with one of the enumeration values. You can specify whether the title is displayed as the month or both the month and the year. - - This property applies only if the property is set to `true`. - - - -## Examples - The following code example demonstrates how to use the property to display the month and year in the title section. - + property to specify the format for the title section. This property is set with one of the enumeration values. You can specify whether the title is displayed as the month or both the month and the year. + + This property applies only if the property is set to `true`. + + + +## Examples + The following code example demonstrates how to use the property to display the month and year in the title section. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.TitleFormat Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TitleFormat Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TitleFormat Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarTitleFormat/CS/calendartitleformatcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTitleFormat/VB/calendartitleformatvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTitleFormat/VB/calendartitleformatvb.aspx" id="Snippet1"::: + ]]> The specified title format is not one of the values. @@ -2346,24 +2346,24 @@ Gets the style properties of the title heading for the control. A that contains the style properties of the title heading for the . The default value is an empty . - control. For more information on the different style properties that can be controlled, see . - - The property applies only when the property is set to `true`. - - - -## Examples - The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for the title heading of the control. - + control. For more information on the different style properties that can be controlled, see . + + The property applies only when the property is set to `true`. + + + +## Examples + The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for the title heading of the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.TitleStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TitleStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TitleStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarTitleStyle/CS/calendartitlestylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTitleStyle/VB/calendartitlestylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTitleStyle/VB/calendartitlestylevb.aspx" id="Snippet1"::: + ]]> @@ -2409,24 +2409,24 @@ Gets the style properties for today's date on the control. A that contains the style properties for today's date on the control. The default value is an empty . - control. If the property is not set, the style specified in the property is used. - - For more information on the different style properties that can be controlled, see . - - - -## Examples - The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for today's date. - + control. If the property is not set, the style specified in the property is used. + + For more information on the different style properties that can be controlled, see . + + + +## Examples + The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for today's date. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.TodayDayStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TodayDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TodayDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarTodayDayStyle/CS/calendartodaydaystylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTodayDayStyle/VB/calendartodaydaystylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarTodayDayStyle/VB/calendartodaydaystylevb.aspx" id="Snippet1"::: + ]]> @@ -2468,27 +2468,27 @@ Gets or sets the value for today's date. A that contains the value that the considers to be today's date. If this property is not explicitly set, this date will be the date on the server. - property to determine today's date. You can also use this property to programmatically set the value for today's date on the control. This property is set using a object. - + property to determine today's date. You can also use this property to programmatically set the value for today's date on the control. This property is set using a object. + > [!NOTE] -> This date might need to be adjusted to accommodate users who are in a different time zone. - - The appearance of the date specified by the property can be customized by using the property. - +> This date might need to be adjusted to accommodate users who are in a different time zone. + + The appearance of the date specified by the property can be customized by using the property. + > [!NOTE] -> If the property is not set, the date specified by the property determines which month is displayed in the control. - - - -## Examples - The following code example demonstrates how to use the property to programmatically set the value for today's date on the control. - +> If the property is not set, the date specified by the property determines which month is displayed in the control. + + + +## Examples + The following code example demonstrates how to use the property to programmatically set the value for today's date on the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.TodaysDate Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TodaysDate Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.TodaysDate Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -2545,13 +2545,13 @@ if the element is used for day header cells; if the element is used for day headers. - ` HTML element is used for day header cells by default. You can revert to the .NET Framework version 1.0 behavior of using `` elements for day header cells by setting this property to `false`. - - Note that changing this value can affect scripts that rely on the rendering behavior of the version 1.0 edition of this control. The use of the `` element might also alter the visible rendering of the control in browsers by making the day header cells center-aligned and bold. - + ` HTML element is used for day header cells by default. You can revert to the .NET Framework version 1.0 behavior of using `` elements for day header cells by setting this property to `false`. + + Note that changing this value can affect scripts that rely on the rendering behavior of the version 1.0 edition of this control. The use of the `` element might also alter the visible rendering of the control in browsers by making the day header cells center-aligned and bold. + ]]>
@@ -2587,21 +2587,21 @@ Gets or sets the value that specifies the month to display on the control. A that specifies the month to display on the . The default value is DateTime.MinValue, which displays the month that contains the date specified by . - property to programmatically set the month to display on the control. The specified date can be any date in the month you want to display, although it is common to use the first date in the month. This property is set using a object. - - The property is updated before the event is raised. You can provide a custom event handler to set the property and override the automatically generated value. - - - -## Examples - The following code example demonstrates how to use the property to programmatically set the value that determines the month that is displayed in the control. - + property to programmatically set the month to display on the control. The specified date can be any date in the month you want to display, although it is common to use the first date in the month. This property is set using a object. + + The property is updated before the event is raised. You can provide a custom event handler to set the property and override the automatically generated value. + + + +## Examples + The following code example demonstrates how to use the property to programmatically set the value that determines the month that is displayed in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.VisibleDate Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.VisibleDate Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.VisibleDate Example/VB/sourcevb.aspx" id="Snippet1"::: + ]]> @@ -2628,24 +2628,24 @@ Occurs when the user clicks the next or previous month navigation controls on the title heading. - event to display whether the control has moved forward or backward one month. - + event to display whether the control has moved forward or backward one month. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarVisibleMonthChanged/CS/calendarvisiblemonthchangedcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged/VB/calendarvisiblemonthchangedvb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarVisibleMonthChanged2/CS/calendarvisiblemonthchanged2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged2/VB/calendarvisiblemonthchanged2vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarVisibleMonthChanged2/VB/calendarvisiblemonthchanged2vb.aspx" id="Snippet1"::: + ]]> @@ -2686,24 +2686,24 @@ Gets the style properties for the weekend dates on the control. A that contains the style properties for the weekend dates on the . The default value is an empty . - control. If the property is not set, the style specified in the property is used. - - For more information on the different style properties that can be controlled, see . - - - -## Examples - The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for weekend dates. - + control. If the property is not set, the style specified in the property is used. + + For more information on the different style properties that can be controlled, see . + + + +## Examples + The following code example demonstrates how to use the property to specify a blue background color and a yellow foreground color for weekend dates. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic Calendar.WeekendDayStyle Example/CS/sourcecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.WeekendDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic Calendar.WeekendDayStyle Example/VB/sourcevb.aspx" id="Snippet1"::: + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CalendarWeekendDayStyle/CS/calendarweekenddaystylecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarWeekendDayStyle/VB/calendarweekenddaystylevb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CalendarWeekendDayStyle/VB/calendarweekenddaystylevb.aspx" id="Snippet1"::: + ]]> diff --git a/xml/System.Web.UI.WebControls/ChangePassword.xml b/xml/System.Web.UI.WebControls/ChangePassword.xml index 2f660f51402..425d64177a7 100644 --- a/xml/System.Web.UI.WebControls/ChangePassword.xml +++ b/xml/System.Web.UI.WebControls/ChangePassword.xml @@ -155,134 +155,134 @@ ## Declarative Syntax -``` +```xml -         -         -         + + + -         -         -         -         -         -         -         + + + + + + -                 -                         -                 -         -         -         + + + + + + -         -         -         -         -         + + + + + ``` @@ -3697,7 +3697,7 @@ > [!IMPORTANT] > Sending user account names or passwords in email is a potential security threat. Email messages are typically sent in plain text and can be read by special network "sniffing" applications. To improve security, use the mitigations that are described in [Securing Login Controls](https://learn.microsoft.com/previous-versions/aspnet/ms178346(v=vs.100)). -``` +```html diff --git a/xml/System.Web.UI.WebControls/CheckBox.xml b/xml/System.Web.UI.WebControls/CheckBox.xml index 922c5bc51c5..ae7429ed87f 100644 --- a/xml/System.Web.UI.WebControls/CheckBox.xml +++ b/xml/System.Web.UI.WebControls/CheckBox.xml @@ -93,49 +93,49 @@ ## Declarative Syntax -``` +```xml ``` diff --git a/xml/System.Web.UI.WebControls/CheckBoxList.xml b/xml/System.Web.UI.WebControls/CheckBoxList.xml index d708443ddc5..bc601edf82e 100644 --- a/xml/System.Web.UI.WebControls/CheckBoxList.xml +++ b/xml/System.Web.UI.WebControls/CheckBoxList.xml @@ -74,70 +74,70 @@ ## Declarative Syntax -``` +```xml -             + ``` diff --git a/xml/System.Web.UI.WebControls/Content.xml b/xml/System.Web.UI.WebControls/Content.xml index 18ff97035b6..6bc8ab1fac2 100644 --- a/xml/System.Web.UI.WebControls/Content.xml +++ b/xml/System.Web.UI.WebControls/Content.xml @@ -39,54 +39,54 @@ Holds text, markup, and server controls to render to a control in a master page. - control is a container for the content and controls of a content page. A control is used only with a master page that defines a corresponding control. A control is not added to the control hierarchy at runtime. Instead, the contents within the control are directly merged into the corresponding control. - - The control is associated with a using its property. Set the property to the value of the property of a control in a master page. When the URL of the content page is called, all text, markup, and server controls that are contained within the control are rendered to the on the master page, and the address bar of the browser will show the name of the content page. - - For more information about master pages and content pages, see [ASP.NET Master Pages](https://learn.microsoft.com/previous-versions/aspnet/wtxbf3hh(v=vs.100)). - - -## Declarative Syntax - -``` - -    Visible="True|False" -         - -``` - - - -## Examples - The following code example shows how to use the control to define the content for a master page. The first Web page is a master page and defines a content region using a control. - - [!code-xml[System.Web.UI.MasterPage_1#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/CS/MasterPageSample_1cs.master#1)] - - The following code example demonstrates how to use a content page for the preceding master page. The text, markup, and any server controls that are defined within the control template are rendered to the on the master page. - -```csharp -<%@ Page Language="C#" MasterPageFile="~/MasterPageSample_1cs.master" Title="Content Page"%> - -Hello, Master Pages! -``` - -```vb -<%@ Page Language="VB" MasterPageFile="~/MasterPageSample_1vb.master" Title="Content Page"%> - -Hello, Master Pages! -``` - + control is a container for the content and controls of a content page. A control is used only with a master page that defines a corresponding control. A control is not added to the control hierarchy at runtime. Instead, the contents within the control are directly merged into the corresponding control. + + The control is associated with a using its property. Set the property to the value of the property of a control in a master page. When the URL of the content page is called, all text, markup, and server controls that are contained within the control are rendered to the on the master page, and the address bar of the browser will show the name of the content page. + + For more information about master pages and content pages, see [ASP.NET Master Pages](https://learn.microsoft.com/previous-versions/aspnet/wtxbf3hh(v=vs.100)). + + +## Declarative Syntax + +```xml + + Visible="True|False" + + +``` + + + +## Examples + The following code example shows how to use the control to define the content for a master page. The first Web page is a master page and defines a content region using a control. + + [!code-xml[System.Web.UI.MasterPage_1#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/CS/MasterPageSample_1cs.master#1)] + + The following code example demonstrates how to use a content page for the preceding master page. The text, markup, and any server controls that are defined within the control template are rendered to the on the master page. + +```csharp +<%@ Page Language="C#" MasterPageFile="~/MasterPageSample_1cs.master" Title="Content Page"%> + +Hello, Master Pages! +``` + +```vb +<%@ Page Language="VB" MasterPageFile="~/MasterPageSample_1vb.master" Title="Content Page"%> + +Hello, Master Pages! +``` + ]]> @@ -115,11 +115,11 @@ Initializes a new instance of the class. - control typically is created declaratively, not programmatically. For an example, see . - + control typically is created declaratively, not programmatically. For an example, see . + ]]> ASP.NET Master Pages Overview @@ -159,36 +159,36 @@ Gets or sets the ID of the control that is associated with the current content. A string containing the ID of the associated with the current content. The default is an empty string (""). - control renders within the referenced control in a master page. A control is not added to the control hierarchy at runtime. - - This property cannot be set by themes or style sheet themes. For more information, see and [ASP.NET Themes and Skins](https://learn.microsoft.com/previous-versions/aspnet/ykzx33wh(v=vs.100)). - - - -## Examples - The following code example shows how to use the property of a control in an ASP.NET Web page. - - This code example is part of a larger example provided for the class. - -```csharp -<%@ Page Language="C#" MasterPageFile="~/MasterPageSample_1cs.master" Title="Content Page"%> - -Hello, Master Pages! -``` - -```vb -<%@ Page Language="VB" MasterPageFile="~/MasterPageSample_1vb.master" Title="Content Page"%> - -Hello, Master Pages! -``` - + control renders within the referenced control in a master page. A control is not added to the control hierarchy at runtime. + + This property cannot be set by themes or style sheet themes. For more information, see and [ASP.NET Themes and Skins](https://learn.microsoft.com/previous-versions/aspnet/ykzx33wh(v=vs.100)). + + + +## Examples + The following code example shows how to use the property of a control in an ASP.NET Web page. + + This code example is part of a larger example provided for the class. + +```csharp +<%@ Page Language="C#" MasterPageFile="~/MasterPageSample_1cs.master" Title="Content Page"%> + +Hello, Master Pages! +``` + +```vb +<%@ Page Language="VB" MasterPageFile="~/MasterPageSample_1vb.master" Title="Content Page"%> + +Hello, Master Pages! +``` + ]]> An attempt was made to set the property at run time. @@ -225,11 +225,11 @@ Occurs when the control binds to a data source. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> @@ -266,11 +266,11 @@ Occurs when the control is released from memory. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> @@ -307,11 +307,11 @@ Occurs when the control is initialized. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> @@ -348,11 +348,11 @@ Occurs when the server control is loaded into the control. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> @@ -389,11 +389,11 @@ Occurs when the server control is about to render to its containing control. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> @@ -430,11 +430,11 @@ Occurs when the server control is unloaded from memory. - event is never invoked and does not appear in visual designers. - + event is never invoked and does not appear in visual designers. + ]]> diff --git a/xml/System.Web.UI.WebControls/ContentPlaceHolder.xml b/xml/System.Web.UI.WebControls/ContentPlaceHolder.xml index ae6b754948a..a68d9bbc3de 100644 --- a/xml/System.Web.UI.WebControls/ContentPlaceHolder.xml +++ b/xml/System.Web.UI.WebControls/ContentPlaceHolder.xml @@ -47,54 +47,54 @@ Defines a region for content in an ASP.NET master page. - control defines a relative region for content in a master page, and renders all text, markup, and server controls from a related control found in a content page. - - A control is associated with a using its property. Set the property to the value of the property of the related control in a master page. More than one can be declared in a master page. - - Within a content page, only one control can supply the content for a in the master page. However, in each content page that uses a master page, you can have separate controls associated with the . For example, you can define the for the page title in a master page. For each content page that uses the master page, you can add a control that supplies the text and markup for the page title. - + control defines a relative region for content in a master page, and renders all text, markup, and server controls from a related control found in a content page. + + A control is associated with a using its property. Set the property to the value of the property of the related control in a master page. More than one can be declared in a master page. + + Within a content page, only one control can supply the content for a in the master page. However, in each content page that uses a master page, you can have separate controls associated with the . For example, you can define the for the page title in a master page. For each content page that uses the master page, you can add a control that supplies the text and markup for the page title. + > [!NOTE] -> For XHTML compliance, an empty title element is created if a title has not been defined or cannot be found. - - You can specify default content placed within the control tags, but this content is replaced by any content in an associated content page. - - For more information about master pages and content pages, see [DEL: ASP.NET Master Pages](https://msdn.microsoft.com/library/0852291d-6f62-4e9f-a809-45cc81e78d6b). - - -## Declarative Syntax - -``` - -         - -``` - - - -## Examples - The following code example shows how the control is used to define a content region for a master page. The first Web page is a master page, and defines a content region using a control. - - [!code-xml[System.Web.UI.MasterPage_1#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/CS/MasterPageSample_1cs.master#1)] - - The following code example demonstrates a content page for the preceding master page. The text, markup, and any server controls defined within the control template are rendered to the on the master page. - +> For XHTML compliance, an empty title element is created if a title has not been defined or cannot be found. + + You can specify default content placed within the control tags, but this content is replaced by any content in an associated content page. + + For more information about master pages and content pages, see [DEL: ASP.NET Master Pages](https://msdn.microsoft.com/library/0852291d-6f62-4e9f-a809-45cc81e78d6b). + + +## Declarative Syntax + +```xml + + + +``` + + + +## Examples + The following code example shows how the control is used to define a content region for a master page. The first Web page is a master page, and defines a content region using a control. + + [!code-xml[System.Web.UI.MasterPage_1#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/CS/MasterPageSample_1cs.master#1)] + + The following code example demonstrates a content page for the preceding master page. The text, markup, and any server controls defined within the control template are rendered to the on the master page. + [!code-csharp[System.Web.UI.MasterPage_1#3](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/CS/samplemasterclass.cs#3)] - [!code-vb[System.Web.UI.MasterPage_1#3](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/VB/samplemasterclass.vb#3)] - + [!code-vb[System.Web.UI.MasterPage_1#3](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.MasterPage_1/VB/samplemasterclass.vb#3)] + ]]> diff --git a/xml/System.Web.UI.WebControls/CreateUserWizard.xml b/xml/System.Web.UI.WebControls/CreateUserWizard.xml index 4a2200dc71b..35097227eac 100644 --- a/xml/System.Web.UI.WebControls/CreateUserWizard.xml +++ b/xml/System.Web.UI.WebControls/CreateUserWizard.xml @@ -134,238 +134,238 @@ ## Declarative Syntax -``` +```xml -         -         -         -         -         -         -         + + + + + + + -         -         -         -         + + + + -         -         -         -         -         + + + + -                 -                         -                 -         -         -         -         -         -         -         + + + + + + + + + + -         -         + + -         -         -         + + + -         -         -         -         -         -         -         -         -                 + + + + + + + + -                         + -                         -                         + + -                         -                 -                 -         + + + + ``` @@ -3084,7 +3084,7 @@ Creates the hierarchy of child controls that make up the control. ## Examples The following code example sets properties of the property by using both declarative and programmatic syntax. This code example requires a text file named MailFile.txt that contains the following text. -``` +```txt Your account was set up on our Web site with the following: Username: <%UserName%> @@ -3095,7 +3095,6 @@ To reset your password, you must answer the following question: Password Answer: <%PasswordAnswer%> Thank you for creating an account with our Web site. - ``` :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CreateUserWizardMailDefinition/CS/createuserwizardmaildefinitioncs.aspx" id="Snippet1"::: diff --git a/xml/System.Web.UI.WebControls/CustomValidator.xml b/xml/System.Web.UI.WebControls/CustomValidator.xml index 02aced7c442..088b3639aea 100644 --- a/xml/System.Web.UI.WebControls/CustomValidator.xml +++ b/xml/System.Web.UI.WebControls/CustomValidator.xml @@ -45,13 +45,13 @@ If you are using Visual Basic Scripting Edition (VBScript), the function must be in this form: -``` +```vbscript Sub ValidationFunctionName(source, arguments) ``` If you are using JScript, the function must be in this form: -``` +```javascript function ValidationFunctionName(source, arguments) ``` diff --git a/xml/System.Web.UI.WebControls/DataGrid.xml b/xml/System.Web.UI.WebControls/DataGrid.xml index 0ed0d487ae9..c386ebea6b8 100644 --- a/xml/System.Web.UI.WebControls/DataGrid.xml +++ b/xml/System.Web.UI.WebControls/DataGrid.xml @@ -123,201 +123,201 @@ ## Declarative Syntax -``` +```xml -         -         -                 + + -                         -                         -                         -                 -                 + + + + -                         -                         -                         -                 -                 + + + + -                         -                         -                         -                 -                 + + + + -                         -                         -                         -                 -                 + + + + -                             -                             -                             -                         + + + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                 -         -         -         -         -         -         -         + Font-Strikeout="True|False" + Font-Underline="True|False" + ForeColor="color name|#dddddd" + Height="size" + HorizontalAlign="NotSet|Left|Center|Right|Justify" + Mode="NextPrev|NumericPages" + NextPageText="string" + OnDisposed="Disposed event handler" + PageButtonCount="integer" + Position="Bottom|Top|TopAndBottom" + PrevPageText="string" + VerticalAlign="NotSet|Top|Middle|Bottom" + Visible="True|False" + Width="size" + Wrap="True|False" + /> + ``` diff --git a/xml/System.Web.UI.WebControls/DataList.xml b/xml/System.Web.UI.WebControls/DataList.xml index 168ca566831..a61ccb2f21d 100644 --- a/xml/System.Web.UI.WebControls/DataList.xml +++ b/xml/System.Web.UI.WebControls/DataList.xml @@ -131,98 +131,98 @@ ## Declarative Syntax -``` +```xml -         -         + + -         -         -         + + + -         -         -         + + + -         -         -         + + + -         -         -         + + + -         -         -         + + + -         -         -         + + + -         + ``` diff --git a/xml/System.Web.UI.WebControls/DataPager.xml b/xml/System.Web.UI.WebControls/DataPager.xml index 546e95e9de2..3054ce48c9c 100644 --- a/xml/System.Web.UI.WebControls/DataPager.xml +++ b/xml/System.Web.UI.WebControls/DataPager.xml @@ -65,123 +65,123 @@ Provides paging functionality for data-bound controls that implement the interface, such as the control. - -## Introduction - The class is used to page data and to display navigation controls for data-bound controls that implement the interface. (An example of a control that implements the interface is the control.) - - You can associate the control with the data-bound control by using the property. Alternatively, you can put the control inside the data-bound control hierarchy. For example, in the control, you can put the control inside the template. - - You can customize the number of items that are displayed for each page of data by changing the property. You can also change the way a page is submitted to the server by setting the property. - - -## Pager Fields - In order for the control to display navigation controls, you must add pager fields to the control. The pager fields derive from the class. The following table lists the pager field types that you can use. - -|Pager field type|Description| -|----------------------|-----------------| -||Enables users to navigate through pages one page at a time, or to jump to the first or last page.| -||Enables users to select a page by page number.| -||Enables you to create a custom paging UI.| - - To declaratively add pager fields to the control, add a `Fields` element to the control. You can then add the pager fields to the `Fields` element. The pager fields are added to the collection in the order that they appear in the `Fields` element. The collection enables you to programmatically manage the pager fields in the control. - - -## Page Properties - The following table lists read-only properties of the control that specify characteristics of the page of data. These properties are usually used for binding expressions in the object. - -|Property|Description| -|--------------|-----------------| -||The maximum number of records that are displayed for each page of data.| -||The index of the first record that is displayed on a page of data.| -||The total number of records that are available in the underlying data source.| - - -## Accessibility - The default markup that is rendered default for this control might not comply with accessibility standards, such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). - - -## Declarative Syntax - -``` - -         -             -             -             -         - -``` - - - -## Examples - The following example shows how to add paging functionality to a control. This example contains two controls that are used to page through data of the same control. - + +## Introduction + The class is used to page data and to display navigation controls for data-bound controls that implement the interface. (An example of a control that implements the interface is the control.) + + You can associate the control with the data-bound control by using the property. Alternatively, you can put the control inside the data-bound control hierarchy. For example, in the control, you can put the control inside the template. + + You can customize the number of items that are displayed for each page of data by changing the property. You can also change the way a page is submitted to the server by setting the property. + + +## Pager Fields + In order for the control to display navigation controls, you must add pager fields to the control. The pager fields derive from the class. The following table lists the pager field types that you can use. + +|Pager field type|Description| +|----------------------|-----------------| +||Enables users to navigate through pages one page at a time, or to jump to the first or last page.| +||Enables users to select a page by page number.| +||Enables you to create a custom paging UI.| + + To declaratively add pager fields to the control, add a `Fields` element to the control. You can then add the pager fields to the `Fields` element. The pager fields are added to the collection in the order that they appear in the `Fields` element. The collection enables you to programmatically manage the pager fields in the control. + + +## Page Properties + The following table lists read-only properties of the control that specify characteristics of the page of data. These properties are usually used for binding expressions in the object. + +|Property|Description| +|--------------|-----------------| +||The maximum number of records that are displayed for each page of data.| +||The index of the first record that is displayed on a page of data.| +||The total number of records that are available in the underlying data source.| + + +## Accessibility + The default markup that is rendered default for this control might not comply with accessibility standards, such as the Web Content Accessibility Guidelines 1.0 (WCAG) priority 1 guidelines. For details about accessibility support for this control, see [ASP.NET Controls and Accessibility](https://learn.microsoft.com/previous-versions/ms227996(v=vs.140)). + + +## Declarative Syntax + +```xml + + + + + + + +``` + + + +## Examples + The following example shows how to add paging functionality to a control. This example contains two controls that are used to page through data of the same control. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPager#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager/CS/DataPagerCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPager#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager/VB/DataPagerVB.aspx#1)] - + [!code-aspx-vb[System.Web.UI.WebControls.DataPager#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager/VB/DataPagerVB.aspx#1)] + ]]> @@ -209,19 +209,19 @@ Initializes a new instance of the class. - control to a page, create a new object. Set its properties, and then add it to the collection of a container control, such as a control. - - - -## Examples - The following example shows how to use the constructor to dynamically add a control to a page. - + control to a page, create a new object. Set its properties, and then add it to the collection of a container control, such as a control. + + + +## Examples + The following example shows how to use the constructor to dynamically add a control to a page. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPager.Ctor#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/CS/DataPagerCtorCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPager.Ctor#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/VB/DataPagerCtorVB.aspx#1)] - + [!code-aspx-vb[System.Web.UI.WebControls.DataPager.Ctor#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/VB/DataPagerCtorVB.aspx#1)] + ]]> @@ -252,11 +252,11 @@ An object that represents the output stream to render HTML content to the browser. Adds HTML attributes and styles to be rendered in the browser to the specified object. - method is primarily used by control developers to insert additional attributes and styles in the output stream for a control. - + method is primarily used by control developers to insert additional attributes and styles in the output stream for a control. + ]]> @@ -293,11 +293,11 @@ Gets a collection of custom attribute name/value pairs for the control. A collection of custom attribute name/value pairs. - collection to manage the attribute name/value pairs that are declared in the opening tag of the control, but that are not directly supported by the class. You can programmatically add or remove attributes to the collection. - + collection to manage the attribute name/value pairs that are declared in the opening tag of the control, but that are not directly supported by the class. You can programmatically add or remove attributes to the collection. + ]]> @@ -327,14 +327,14 @@ The data-bound control that raises the event. Connects events to event handler methods in the control. - method specifies the method as the handler for the event of the control specified in `container`. The `container` parameter must contain a data-bound control that implements the interface, such as a control. - + method specifies the method as the handler for the event of the control specified in `container`. The `container` parameter must contain a data-bound control that implements the interface, such as a control. + > [!NOTE] -> This method is primarily used by control developers to extend the control. - +> This method is primarily used by control developers to extend the control. + ]]> @@ -366,11 +366,11 @@ Gets a object that represents the child controls for the control in the UI hierarchy. The collection of child controls for the control. - @@ -400,19 +400,19 @@ Creates the objects that are contained by the property of the control. - method is used by the property and by the method to create the objects that are contained by the property. This method calls the method to create the user interface (UI) controls for each field in the collection. - - The pager fields are created in the control in the order that the pager fields appear in the collection. The following table shows the pager field classes that derive from the class and that can be created in the control. - -|Pager field type|Description| -|----------------------|-----------------| -||Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.| -||Enables users to select a page of data by page number.| -||Enables you to create a custom paging UI.| - + method is used by the property and by the method to create the objects that are contained by the property. This method calls the method to create the user interface (UI) controls for each field in the collection. + + The pager fields are created in the control in the order that the pager fields appear in the collection. The following table shows the pager field classes that derive from the class and that can be created in the control. + +|Pager field type|Description| +|----------------------|-----------------| +||Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.| +||Enables users to select a page of data by page number.| +||Enables you to create a custom paging UI.| + ]]> @@ -443,11 +443,11 @@ Binds the control and all its child controls to a data source. - method overrides the base class implementation. The overridden method verifies that all child controls have been created before binding them to a data source. - + method overrides the base class implementation. The overridden method verifies that all child controls have been created before binding them to a data source. + ]]> @@ -501,34 +501,34 @@ Gets a collection of objects that represent the pager fields that are specified in a control. A collection object that contains all the pager fields that are specified in the control. - control in the order that the pager fields appear in the collection. The following table shows the pager field classes that derive from the class and that can be used in the collection. - -|Pager field type|Description| -|----------------------|-----------------| -||Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.| -||Enables users to select a page of data by page number.| -||Enables you to create a custom paging UI.| - - To declaratively specify the pager fields for a control, put a `Fields` element inside the control. You can then list the pager fields you want to include between the opening and closing `` tags. - - You can programmatically add pager fields to the collection. However, it is easier to list the pager fields declaratively in the control. - - - -## Examples - The following example shows how to declaratively add pager fields to the collection of a control. - + control in the order that the pager fields appear in the collection. The following table shows the pager field classes that derive from the class and that can be used in the collection. + +|Pager field type|Description| +|----------------------|-----------------| +||Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.| +||Enables users to select a page of data by page number.| +||Enables you to create a custom paging UI.| + + To declaratively specify the pager fields for a control, put a `Fields` element inside the control. You can then list the pager fields you want to include between the opening and closing `` tags. + + You can programmatically add pager fields to the collection. However, it is easier to list the pager fields declaratively in the control. + + + +## Examples + The following example shows how to declaratively add pager fields to the collection of a control. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPagerField#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPagerField/CS/DataPagerFieldCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPagerField#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPagerField/VB/DataPagerFieldVB.aspx#1)] - - The following example shows how to use the property to dynamically add a object to a control. This code example is part of a larger example provided for the constructor. - + [!code-aspx-vb[System.Web.UI.WebControls.DataPagerField#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPagerField/VB/DataPagerFieldVB.aspx#1)] + + The following example shows how to use the property to dynamically add a object to a control. This code example is part of a larger example provided for the constructor. + [!code-csharp[System.Web.UI.WebControls.NextPreviousPagerField.Ctor#2](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.NextPreviousPagerField.Ctor/CS/NextPreviousPagerFieldCtorCS.aspx#2)] - [!code-vb[System.Web.UI.WebControls.NextPreviousPagerField.Ctor#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.NextPreviousPagerField.Ctor/VB/NextPreviousPagerFieldCtorVB.aspx#2)] - + [!code-vb[System.Web.UI.WebControls.NextPreviousPagerField.Ctor#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.NextPreviousPagerField.Ctor/VB/NextPreviousPagerFieldCtorVB.aspx#2)] + ]]> @@ -560,23 +560,23 @@ Retrieves the data-bound control that is associated with the control. The data-bound control that is associated with the control. - control pages. For the control to be able to page this data, the data-bound control must implement the interface. - - The method checks whether the property is set to the ID of a data-bound control. If the property is not set, the method goes up the stack of naming containers to look for a data-bound control. For example, if the control is inside the template of a control, the property does not have to be set. This is because the method can automatically find the control by examining the control tree. - + control pages. For the control to be able to page this data, the data-bound control must implement the interface. + + The method checks whether the property is set to the ID of a data-bound control. If the property is not set, the method goes up the stack of naming containers to look for a data-bound control. For example, if the control is inside the template of a control, the property does not have to be set. This is because the method can automatically find the control by examining the control tree. + ]]> - A control that implements the interface was not found on the page. - - -or- - - The control specified by the property does not implement the interface. - - -or- - + A control that implements the interface was not found on the page. + + -or- + + The control specified by the property does not implement the interface. + + -or- + The control does not have a naming container. @@ -609,11 +609,11 @@ An object that represents the state of the control. Loads the state information for the properties in the control that must be persisted between postbacks, even when the property is set to . - control. - + control. + ]]> There is no data-bound control associated with the control. @@ -647,11 +647,11 @@ An object that represents the state to be restored. Restores view-state information for the control that was saved by the method during a previous page request. - @@ -693,11 +693,11 @@ Gets the maximum number of records that are displayed for each page of data. The maximum number of records that are displayed for each page of data. - property to retrieve the size of a page of data. The property contains the same value as the property. You can change the value of this property by setting the property. - + property to retrieve the size of a page of data. The property contains the same value as the property. You can change the value of this property by setting the property. + ]]> @@ -757,15 +757,15 @@ The event data. Raises the event. - method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]> @@ -798,15 +798,15 @@ The event data. Raises the event. - method notifies the server control that it should perform actions that are common to each HTTP request for the page that it is associated with. At this stage in the page life cycle, server controls in the hierarchy are created and initialized. View state is restored, and form controls reflect values that were posted from the client. This implementation also invokes the method to find the container control that implements the interface, and it initializes the page properties. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - The method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. - + method notifies the server control that it should perform actions that are common to each HTTP request for the page that it is associated with. At this stage in the page life cycle, server controls in the hierarchy are created and initialized. View state is restored, and form controls reflect values that were posted from the client. This implementation also invokes the method to find the container control that implements the interface, and it initializes the page properties. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + The method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class. + ]]> A container control that implements the interface was not found. @@ -844,11 +844,11 @@ The event data. Handles the event. - control raises the event when the total number of records in its underlying data source is available. The method is a handler for this event and is responsible for updating the page-related properties and recreating the pager field objects. - + control raises the event when the total number of records in its underlying data source is available. The method is a handler for this event and is responsible for updating the page-related properties and recreating the pager field objects. + ]]> @@ -890,28 +890,28 @@ Gets or sets the of the control that contains the data that will be paged by the control. The of the control that contains the data that will be paged by the control. The default is an empty string, which indicates that this property is not set. - property to specify the of the control that contains the data that will be paged by the control. The specified control must implement the interface and must use the same naming container as the control. An example of a control that you can specify is the control. - - If this property is an empty string or `null`, the control checks whether its container control implements the interface. For example, in the control, the property does not have to be set if you put the control inside the template. This is because the control can automatically find the control by examining the control tree. - - The value of this property is stored in view state. - - - -## Examples - The following example shows how to use the property to dynamically associate a control with a control. This code example is part of a larger example provided for the constructor. - + property to specify the of the control that contains the data that will be paged by the control. The specified control must implement the interface and must use the same naming container as the control. An example of a control that you can specify is the control. + + If this property is an empty string or `null`, the control checks whether its container control implements the interface. For example, in the control, the property does not have to be set if you put the control inside the template. This is because the control can automatically find the control by examining the control tree. + + The value of this property is stored in view state. + + + +## Examples + The following example shows how to use the property to dynamically associate a control with a control. This code example is part of a larger example provided for the constructor. + [!code-csharp[System.Web.UI.WebControls.DataPager.Ctor#2](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/CS/DataPagerCtorCS.aspx#2)] - [!code-vb[System.Web.UI.WebControls.DataPager.Ctor#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/VB/DataPagerCtorVB.aspx#2)] - - The following example shows how to declaratively set the property in a control in order to page the data of a control. - + [!code-vb[System.Web.UI.WebControls.DataPager.Ctor#2](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.Ctor/VB/DataPagerCtorVB.aspx#2)] + + The following example shows how to declaratively set the property in a control in order to page the data of a control. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPager.PagedControlID#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PagedControlID/CS/DataPagerPagedControlIDCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPager.PagedControlID#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PagedControlID/VB/DataPagerPagedControlIDVB.aspx#1)] - + [!code-aspx-vb[System.Web.UI.WebControls.DataPager.PagedControlID#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PagedControlID/VB/DataPagerPagedControlIDVB.aspx#1)] + ]]> @@ -951,21 +951,21 @@ Gets or sets the number of records that are displayed for each page of data. The number of records that are displayed for each page of data. The default is 10. - property to specify the size of a page of data. - - If you have multiple controls in a page that are bound to the same control, be sure to set the property of these controls to the same value. If the controls are set to use different page sizes, the last control to be initialized determines the actual page size of the control. - - - -## Examples - The following example shows how to declaratively set the property in a control and how to dynamically change its value. - + property to specify the size of a page of data. + + If you have multiple controls in a page that are bound to the same control, be sure to set the property of these controls to the same value. If the controls are set to use different page sizes, the last control to be initialized determines the actual page size of the control. + + + +## Examples + The following example shows how to declaratively set the property in a control and how to dynamically change its value. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPager.PageSize#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PageSize/CS/DataPagerPageSizeCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPager.PageSize#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PageSize/VB/DataPagerPageSizeVB.aspx#1)] - + [!code-aspx-vb[System.Web.UI.WebControls.DataPager.PageSize#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.PageSize/VB/DataPagerPageSizeVB.aspx#1)] + ]]> The property is set to a value less than 1. @@ -999,31 +999,31 @@ Gets or sets the name of the query string field. The name of the query string field. The default is an empty string, which indicates that the control will use a HTTP POST command to navigate through the pages. - property to specify that the control uses an HTTP GET command to navigate through the pages. In GET requests, a query string field that consists of a name/value pair is added to the URL of the page. The name is set by using the property. The value is the corresponding page number. If is an empty string or `null`, the control uses an HTTP POST command to navigate through the pages. - - Setting this property is useful if you want to have all the pages of data indexed by a search engine. This occurs because the control produces a different URL for each page of data. - - When you set the property, the following conditions might apply: - -- You have more than one control in a page and they reference the same data-bound control. In that case, make sure that the property of these controls is set to the same value. - -- You have more than one control in a page and they reference different data-bound controls. In that case, make sure that the property of these controls is set to different values. If you set the controls to the same value, the associated data-bound controls will be paginated at the same time, because they will use the same query-string field. - - If you do not follow the previous guidelines, unexpected paging behavior can occur. However, no exception will be thrown by the control. - - If property is not an empty string or `null`, the value of the property of or objects is ignored. In that case, these objects use the control to create their navigation buttons. - - - -## Examples - The following example shows how to declaratively set the property in a control in order to navigate through the pages by using a query string. This example contains two controls that are used to page through the data that is displayed by a single control. - + property to specify that the control uses an HTTP GET command to navigate through the pages. In GET requests, a query string field that consists of a name/value pair is added to the URL of the page. The name is set by using the property. The value is the corresponding page number. If is an empty string or `null`, the control uses an HTTP POST command to navigate through the pages. + + Setting this property is useful if you want to have all the pages of data indexed by a search engine. This occurs because the control produces a different URL for each page of data. + + When you set the property, the following conditions might apply: + +- You have more than one control in a page and they reference the same data-bound control. In that case, make sure that the property of these controls is set to the same value. + +- You have more than one control in a page and they reference different data-bound controls. In that case, make sure that the property of these controls is set to different values. If you set the controls to the same value, the associated data-bound controls will be paginated at the same time, because they will use the same query-string field. + + If you do not follow the previous guidelines, unexpected paging behavior can occur. However, no exception will be thrown by the control. + + If property is not an empty string or `null`, the value of the property of or objects is ignored. In that case, these objects use the control to create their navigation buttons. + + + +## Examples + The following example shows how to declaratively set the property in a control in order to navigate through the pages by using a query string. This example contains two controls that are used to page through the data that is displayed by a single control. + [!code-aspx-csharp[System.Web.UI.WebControls.DataPager.QueryStringField#1](~/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.QueryStringField/CS/DataPagerQueryStringFieldCS.aspx#1)] - [!code-aspx-vb[System.Web.UI.WebControls.DataPager.QueryStringField#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.QueryStringField/VB/DataPagerQueryStringFieldVB.aspx#1)] - + [!code-aspx-vb[System.Web.UI.WebControls.DataPager.QueryStringField#1](~/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.DataPager.QueryStringField/VB/DataPagerQueryStringFieldVB.aspx#1)] + ]]> @@ -1052,14 +1052,14 @@ Creates child controls of the control at design time. - method is the implementation of the interface method. - + method is the implementation of the interface method. + > [!NOTE] -> This method is primarily used by control developers to extend the control. - +> This method is primarily used by control developers to extend the control. + ]]> ListView Web Server Control @@ -1088,14 +1088,14 @@ The object that receives the control content. Sends the control content to the specified object, which writes the content to be rendered to the browser. - method writes the content of the control and its child controls to the browser by using the specified object. - + method writes the content of the control and its child controls to the browser by using the specified object. + > [!NOTE] -> This method is primarily used by control developers to extend the control. - +> This method is primarily used by control developers to extend the control. + ]]> @@ -1128,11 +1128,11 @@ An object that represents the output stream to render HTML content to the browser. Renders the HTML opening tag of the control to the specified writer. - control. - + control. + ]]> @@ -1163,14 +1163,14 @@ An object that represents the output stream to render HTML content to the browser. Renders the contents of the control to the specified writer. - method calls the method to render its contents. - + method calls the method to render its contents. + > [!NOTE] -> This method is primarily used by control developers to extend the control. - +> This method is primarily used by control developers to extend the control. + ]]> @@ -1200,11 +1200,11 @@ Saves the state of the properties in the control that must be persisted between postbacks, even when the property is set to . Returns the current view state of the control. If there is no view state associated with the control, this method returns . - control. - + control. + ]]> @@ -1232,16 +1232,16 @@ Saves any changes to an control's view-state that have occurred since the time the page was posted back to the server. Returns the control's current view state. If there is no view state associated with the control, this method returns . - property, which is an instance of the class. This property's value is then persisted to a string object after the save-state stage of the server control life cycle. For more information, see [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). - - When view state is saved, this string object is sent to the browser as a variable that is stored in a hidden element in the page. When you create custom server controls, you can improve efficiency by overriding this method and modifying the server control's `ViewState` property. For more information, see [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). - + property, which is an instance of the class. This property's value is then persisted to a string object after the save-state stage of the server control life cycle. For more information, see [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). + + When view state is saved, this string object is sent to the browser as a variable that is stored in a hidden element in the page. When you create custom server controls, you can improve efficiency by overriding this method and modifying the server control's `ViewState` property. For more information, see [ASP.NET State Management Overview](https://learn.microsoft.com/previous-versions/aspnet/75x4ha6s(v=vs.100)). + > [!NOTE] -> This method is primarily used by control developers to extend the control. - +> This method is primarily used by control developers to extend the control. + ]]> @@ -1279,11 +1279,11 @@ to rebind the control after the properties are set; otherwise, . Sets the page-related properties in the control. - method sets new values for the and properties. It also invokes the method to update the page-related properties in the associated data-bound control. - + method sets new values for the and properties. It also invokes the method to update the page-related properties in the associated data-bound control. + ]]> There is no data-bound control associated with the control. @@ -1358,11 +1358,11 @@ Retrieves the attribute value with the specified name from the control. The value of the attribute. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1397,11 +1397,11 @@ The value of the attribute. Sets an attribute of the control with the specified name and value. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1437,13 +1437,13 @@ Creates the child controls of the control at design time. - method enables a designer for the control to re-create the control's child controls at design time. - - The interface method invokes the method, which contains the actual implementation and which can be extended by control developers. - + method enables a designer for the control to re-create the control's child controls at design time. + + The interface method invokes the method, which contains the actual implementation and which can be extended by control developers. + ]]> @@ -1481,14 +1481,14 @@ Gets the HTML element that is used to render the control. Always . - property returns an HTML element that is used by the method to write the appropriate markup for the control. This property overrides the base implementation to always return . - + property returns an HTML element that is used by the method to write the appropriate markup for the control. This property overrides the base implementation to always return . + > [!NOTE] -> This property is primarily used by control developers to extend the control. - +> This property is primarily used by control developers to extend the control. + ]]> @@ -1555,11 +1555,11 @@ Tracks view-state changes to the control so that they can be stored in the control's object. This object can be accessed through the property. - method is called automatically at the end of the event in the control's life cycle. This method alerts ASP.NET to monitor changes to the server control's view state. - + method is called automatically at the end of the event in the control's life cycle. This method alerts ASP.NET to monitor changes to the server control's view state. + ]]> diff --git a/xml/System.Web.UI.WebControls/DetailsView.xml b/xml/System.Web.UI.WebControls/DetailsView.xml index 59b80e285a3..6d96f5ef4e9 100644 --- a/xml/System.Web.UI.WebControls/DetailsView.xml +++ b/xml/System.Web.UI.WebControls/DetailsView.xml @@ -214,331 +214,331 @@ ## Declarative Syntax -``` +```xml -         -         -         -         -         + + + + + -         -         -         -                 + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                             -                             -                             -                             -                         + + + + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                 -         -         -         + + + + + -         -         -         + + + -         -         -         -         -         + NextPageImageUrl="uri" + NextPageText="string" + OnPropertyChanged="PropertyChanged event handler" + PageButtonCount="integer" + Position="Bottom|Top|TopAndBottom" + PreviousPageImageUrl="uri" + PreviousPageText="string" + Visible="True|False" + /> + + -         -         + + ``` diff --git a/xml/System.Web.UI.WebControls/DropDownList.xml b/xml/System.Web.UI.WebControls/DropDownList.xml index f40a4b2b671..a4e2d22d73d 100644 --- a/xml/System.Web.UI.WebControls/DropDownList.xml +++ b/xml/System.Web.UI.WebControls/DropDownList.xml @@ -32,110 +32,110 @@ Represents a control that allows the user to select a single item from a drop-down list. - -## Introduction - Use the control to create a single-selection drop-down list control. You can control the appearance of the control by setting the , , and properties. - - To specify the items that you want to appear in the control, place a object 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, create a data source, such as a object, that contains the items to display in the control. Then, use the method to bind the data source to the control. - - Use the property to programmatically determine the index of the item selected by the user from the control. The index can then be used to retrieve the selected item from the `Items` collection of the control. - - -## 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=191893). - - The following code example demonstrates how to create a control that contains four items. - + +## Introduction + Use the control to create a single-selection drop-down list control. You can control the appearance of the control by setting the , , and properties. + + To specify the items that you want to appear in the control, place a object 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, create a data source, such as a object, that contains the items to display in the control. Then, use the method to bind the data source to the control. + + Use the property to programmatically determine the index of the item selected by the user from the control. The index can then be used to retrieve the selected item from the `Items` collection of the control. + + +## 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 + +```xml + + + +``` + + + +## Examples + A Visual Studio Web site project with source code is available to accompany this topic: [Download](https://go.microsoft.com/fwlink/?LinkId=191893). + + The following code example demonstrates how to create a control that contains four items. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DropDownListDeclarative/CS/dropdownlistdeclarativecs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListDeclarative/VB/dropdownlistdeclarativevb.aspx" id="Snippet1"::: - - The following code example demonstrates how to create a control though data binding. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListDeclarative/VB/dropdownlistdeclarativevb.aspx" id="Snippet1"::: + + The following code example demonstrates how to create a control though data binding. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DropDownListDataBinding/CS/dropdownlistdatabindingcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListDataBinding/VB/dropdownlistdatabindingvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListDataBinding/VB/dropdownlistdatabindingvb.aspx" id="Snippet1"::: + ]]> @@ -170,19 +170,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="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DropDownListCtor/CS/dropdownlistctorcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListCtor/VB/dropdownlistctorvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListCtor/VB/dropdownlistctorvb.aspx" id="Snippet1"::: + ]]> @@ -211,11 +211,11 @@ An that represents the output stream that renders HTML contents to the client. Adds HTML attributes and styles that need to be rendered to the specified object. - class. - + class. + ]]> @@ -247,23 +247,23 @@ Gets or sets the border color of the control. A that represents the border color of the control. - [!NOTE] -> The property is inherited from the class and is not applicable to the control. - - - -## Examples - The following code example demonstrates how to get or set the property in a custom control. For information about using custom server controls, see [Walkthrough: Developing and Using a Custom Web Server Control](https://msdn.microsoft.com/library/6d90782a-a1a4-45a6-b2d4-cf6362b83b08). - +> The property is inherited from the class and is not applicable to the control. + + + +## Examples + The following code example demonstrates how to get or set the property in a custom control. For information about using custom server controls, see [Walkthrough: Developing and Using a Custom Web Server Control](https://msdn.microsoft.com/library/6d90782a-a1a4-45a6-b2d4-cf6362b83b08). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDropDownListBorderColor/CS/custom_dropdownlist_bordercolorcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListBorderColor/VB/custom_dropdownlist_bordercolorvb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListBorderColor/VB/custom_dropdownlist_bordercolorvb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDropDownListBorderColor/CS/custom_dropdownlist_bordercolor.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListBorderColor/VB/custom_dropdownlist_bordercolor.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListBorderColor/VB/custom_dropdownlist_bordercolor.vb" id="Snippet2"::: + ]]> @@ -295,13 +295,13 @@ Gets or sets the border style of the control. One of the values. - [!NOTE] -> The property is inherited from the class and is not applicable to the control. - +> The property is inherited from the class and is not applicable to the control. + ]]> @@ -333,13 +333,13 @@ Gets or sets the border width for the control. A that represents the border width for the control. - [!NOTE] -> The property is inherited from the class and is not applicable to the control. - +> The property is inherited from the class and is not applicable to the control. + ]]> @@ -366,16 +366,16 @@ Creates a collection to store child controls. Always returns an . - method in a custom server control so that it always returns a new instance of the class for the control. For information about using custom server controls, see [Walkthrough: Developing and Using a Custom Web Server Control](https://msdn.microsoft.com/library/6d90782a-a1a4-45a6-b2d4-cf6362b83b08). - + method in a custom server control so that it always returns a new instance of the class for the control. For information about using custom server controls, see [Walkthrough: Developing and Using a Custom Web Server Control](https://msdn.microsoft.com/library/6d90782a-a1a4-45a6-b2d4-cf6362b83b08). + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/CS/custom_dropdownlist_createcontrolcollectioncs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/VB/custom_dropdownlist_createcontrolcollectionvb.aspx" id="Snippet1"::: + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/VB/custom_dropdownlist_createcontrolcollectionvb.aspx" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/CS/custom_dropdownlist_createcontrolcollection.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/VB/custom_dropdownlist_createcontrolcollection.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/CustomDropDownListCreateControlCollection/VB/custom_dropdownlist_createcontrolcollection.vb" id="Snippet2"::: + ]]> @@ -407,11 +407,11 @@ if the control's state changes as a result of the postback event; otherwise, . - method on the control. - + method on the control. + ]]> @@ -436,11 +436,11 @@ Raises events for the control when postback occurs. - method on a control when the method indicates that the state of the list items has 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 items in the control. - + method on a control when the method indicates that the state of the list items has 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 items in the control. + ]]> @@ -500,22 +500,22 @@ Gets or sets the index of the selected item in the control. The index of the selected item in the control. The default value is 0, which selects the first item in the list. - property to programmatically specify or determine the index of the selected item from the control. An item is always selected in the control. You cannot clear the selection from every item in the list at the same time. - + property to programmatically specify or determine the index of the selected item from the control. An item is always selected in the control. You cannot clear the selection from every item in the list at the same time. + > [!NOTE] -> The indexes for the items in the control are zero-based. - - - -## Examples - The following code example demonstrates how to use the property to determine the selected item in the control. - +> The indexes for the items in the control are zero-based. + + + +## Examples + The following code example demonstrates how to use the property to determine the selected item in the control. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/DropDownListSelectedIndex/CS/dropdownlistselectedindexcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListSelectedIndex/VB/dropdownlistselectedindexvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/DropDownListSelectedIndex/VB/dropdownlistselectedindexvb.aspx" id="Snippet1"::: + ]]> @@ -541,11 +541,11 @@ if the property indicates an ASP.NET version lower than 4.0; otherwise, . - . - + . + ]]> @@ -669,12 +669,12 @@ This member is an explicit interface member implementation. It can be used only Gets or sets the ToolTip text displayed when the mouse pointer rests over the control. The ToolTip text displayed when the mouse pointer rests over the control. - [!NOTE] -> The `ToolTip` property is inherited from the class and is not applicable to the control. +> The `ToolTip` property is inherited from the class and is not applicable to the control. > This implementation of the `ToolTip` property doesn't allow you to set a value and returns if you use the get accessor. ]]> @@ -701,11 +701,11 @@ This member is an explicit interface member implementation. It can be used only Always throws an exception because multiple selection is not supported for the control. - control does not support multiple selections and throws an exception. - + control does not support multiple selections and throws an exception. + ]]> In all cases. diff --git a/xml/System.Web.UI.WebControls/EmbeddedMailObject.xml b/xml/System.Web.UI.WebControls/EmbeddedMailObject.xml index 1f163a32b4a..5b31375e0e5 100644 --- a/xml/System.Web.UI.WebControls/EmbeddedMailObject.xml +++ b/xml/System.Web.UI.WebControls/EmbeddedMailObject.xml @@ -159,7 +159,7 @@ > [!IMPORTANT] > Sending user account names or passwords in an email message is a potential security threat. Email messages are typically sent in plain text and can be read by special network "sniffing" applications. To improve security, use the mitigations that are described in [Securing Login Controls](https://learn.microsoft.com/previous-versions/aspnet/ms178346(v=vs.100)). -``` +```html @@ -232,7 +232,7 @@ ## Remarks The property specifies an identifier for an item to embed in a mail message constructed declaratively with the class. The identifier is used to map the item contained in the property to its appropriate location in the body of the file specified in the property, using the following syntax: -``` +```html Alternate Text ``` diff --git a/xml/System.Web.UI.WebControls/EntityDataSource.xml b/xml/System.Web.UI.WebControls/EntityDataSource.xml index 20708b28cae..bde4d1bfad1 100644 --- a/xml/System.Web.UI.WebControls/EntityDataSource.xml +++ b/xml/System.Web.UI.WebControls/EntityDataSource.xml @@ -79,52 +79,52 @@ ## Declarative Syntax -``` +```xml -         -         -         -         -         -         -         -         + + + + + + + + ``` @@ -236,7 +236,7 @@ ## Examples The following example automatically generates the ORDER BY clause and uses the value of the `OrderByDropDownList` to set the value of the parameter. -``` +```xml @@ -257,7 +257,7 @@ AutoGenerateOrderByClause="True"> The following example automatically generates the ORDER BY clause and uses the `DefaultValue` attribute of the `Parameter` element to set the value of the parameter. -``` +```xml ## Examples In the following example the property is set to `true`. Therefore, the of the property has to match an entity type property name that is included in the query results. The query selects the SalesOrderID and TotalDue properties of the SalesOrderHeader entity type. The automatically generated `WHERE` clause will filter the query results by comparing the TotalDue value to a value selected in the TotalDueList list box control. -``` +```xml ## Examples By default, the property is set to `false`. This means that we have to supply the `WHERE` clause. In the following example, the `WHERE` clause is `Where="it.TotalDue < @totalDueParam"` and totalDueParam is the parameter name. -``` +```xml ## Remarks The property is used to access the of parameters that are passed to an explicit Entity SQL query that is specified using the property. - - ## Examples The following example supplies Entity SQL command text that returns a collection of Product objects. -``` +```xml ControlID="ProductIdMax" Type="Int32" /> - ``` The following example returns a projected series of columns: -``` +```xml ControlID="ProductIDMaxTextBox" Type="Int32" /> - ``` ]]>
@@ -581,7 +577,7 @@ AutoGenerateOrderByClause="True"> ## Examples The following example uses the supplied Entity SQL command to returns a collection of Product objects. -``` +```xml ControlID="ProductIdMax" Type="Int32" /> - ``` The following example returns a projected series of columns: -``` +```xml ControlID="ProductIDMaxTextBox" Type="Int32" /> - ``` ]]> @@ -787,7 +781,6 @@ protected void EntityDataSource2_ContextDisposing(object sender, { e.Cancel = true; } - ``` ]]> @@ -1496,7 +1489,7 @@ protected void EntityDataSource2_ContextDisposing(object sender, ## Examples The following XML markup defines a query path that returns `SalesOrderHeader` objects related to the returned `Contact` object. With each `SalesOrderHeader`, the related `SalesOrderDetail` and `Address` objects are also returned. -``` +```xml named `customers`: -``` +```csharp ObjectQuery customers = context.Contact .Where("it.ContactID = @ContactID", new ObjectParameter("ContactID", customerId)) .Include("SalesOrderHeader.SalesOrderDetail") .Include("SalesOrderHeader.Address"); - ``` ]]> @@ -1754,14 +1746,12 @@ ObjectQuery customers = property of the control is a string that represents an [ORDER BY](/dotnet/framework/data/adonet/ef/language-reference/order-by-entity-sql) expression of an Entity SQL query. This string is passed, without modification, to an that is executed by the Entity Framework. This query is the source of the data regulated by the control. The string supplied to the property uses the same format as the string that is passed to the method of . For examples of how to use the [ORDER BY](/dotnet/framework/data/adonet/ef/language-reference/order-by-entity-sql) clause to order query results, see [How to: Sort Data](https://msdn.microsoft.com/library/c05f2506-cb9d-4ebc-822b-300042ad53e7). - - + The property of the control is a string that represents an [ORDER BY](/dotnet/framework/data/adonet/ef/language-reference/order-by-entity-sql) expression of an Entity SQL query. This string is passed, without modification, to an that is executed by the Entity Framework. This query is the source of the data regulated by the control. The string supplied to the property uses the same format as the string that is passed to the method of . For examples of how to use the [ORDER BY](/dotnet/framework/data/adonet/ef/language-reference/order-by-entity-sql) clause to order query results, see [How to: Sort Data](/previous-versions/dotnet/netframework-4.0/cc716784(v=vs.100)). ## Examples The XML markup in the following example, in an .aspx file, retrieves a value from a control and passes it as a parameter to the property. -``` +```xml customers = DefaultValue="2500" Name="ordercost" PropertyName="Text" /> - ``` The previous XML example is equivalent to the following named `onlineOrders`: -``` +```csharp ObjectQuery onlineOrders = context.SalesOrderHeader .Where("it.OnlineOrderFlag = TRUE AND it.TotalDue > @ordercost", new ObjectParameter("ordercost", orderCost)) .OrderBy("it.TotalDue DESC"); - ``` ]]> @@ -1839,7 +1827,7 @@ ObjectQuery onlineOrders = ## Examples The following example automatically generates the ORDER BY clause and uses the value of the `orderByDropDownList` to set the value of the parameter. -``` +```xml onlineOrders = ControlID="orderByDropDownList" Type="String" /> - ``` ]]> @@ -1962,7 +1949,7 @@ ObjectQuery onlineOrders = ## Examples The following XML markup uses the property to specify a projection with six of the properties of the Product type: -``` +```xml onlineOrders = Select="it.[ProductID], it.[Name], it.[ListPrice], it.[Size], it.[Style], it.[Weight]"> - ``` The previous XML example is the same as the following named `products`: -``` +```csharp ObjectQuery products = context.Product .Select(it.[ProductID], it.[Name], it.[ListPrice], it.[Size], it.[Style], it.[Weight]) .OrderBy("it.[ProductID]"); - ``` ]]> @@ -2419,7 +2404,7 @@ ObjectQuery products = context.Product ## Examples The XML markup in the following example, in an .aspx file, retrieves a value from a control and passes it as a parameter to the property. -``` +```xml products = context.Product DefaultValue="2500" Name="ordercost" PropertyName="Text" /> - ``` The previous XML example is the same as the following named `onlineOrders`: -``` +```csharp ObjectQuery onlineOrders = context.SalesOrderHeader .Where("it.OnlineOrderFlag = TRUE AND it.TotalDue > @ordercost", @@ -2501,7 +2485,7 @@ ObjectQuery onlineOrders = ## Examples The XML markup in the following example, in an .aspx file, retrieves a value from a control and passes it as a parameter to the property. -``` +```xml onlineOrders = DefaultValue="2500" Name="ordercost" PropertyName="Text" /> - ``` The previous XML example is the same as the following named `onlineOrders`: -``` +```csharp ObjectQuery onlineOrders = context.SalesOrderHeader .Where("it.OnlineOrderFlag = TRUE AND it.TotalDue > @ordercost", new ObjectParameter("ordercost", orderCost)) .OrderBy("it.TotalDue DESC"); - ``` ]]> diff --git a/xml/System.Web.UI.WebControls/FileUpload.xml b/xml/System.Web.UI.WebControls/FileUpload.xml index 6e00e4b809f..4c52c5eff04 100644 --- a/xml/System.Web.UI.WebControls/FileUpload.xml +++ b/xml/System.Web.UI.WebControls/FileUpload.xml @@ -35,141 +35,141 @@ Displays a text box control and a browse button that enable users to select a file to upload to the server. - -## Introduction - The class displays a text box control and a browse button that enable users to select a file on the client and upload it to the Web server. The user specifies the file to upload by entering the full path of the file on the local computer (for example, **C:\MyFiles\TestFile.txt**) in the text box of the control. Alternately, the user can select the file by clicking the **Browse** button, and then locating it in the **Choose File** dialog box. - - Use the property to get the name of a file on a client to upload by using the control. The file name that this property returns does not include the path of the file on the client. - - The property gets a object that points to a file to upload. Use this property to access the contents of the file as bytes. For example, you can use the object that is returned by the property to read the contents of the file as bytes and store them in a byte array. Alternatively, you can use the property to retrieve all the bytes in the file. - - The property gets the underlying object for the file to upload. You can use this property to access additional properties on the file. The property gets the length of the file. The property gets the MIME content type of the file. In addition, you can use the property to access the property, the property, and the method. However, the same functionality is provided by the property, the property, and the method. - - -## Saving Uploaded Files - The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. The code that you write to save the specified file should call the method, which saves the contents of a file to a specified path on the server. Typically, the method is called in an event-handling method for an event that raises a post back to the server. For example, if you provide a button to submit a file, you could include the code to save the file inside the event-handling method for the click event. - - Before calling the method to save the file to the server, use the property to verify that the control contains a file. If the returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. Do not check the property to determine whether a file to upload exists because, by default, this property contains 0 bytes. As a result, even when the control is blank, the property returns a non-null value. - - -## Security Considerations - When you call the method, you must specify the full path of the directory in which to save the uploaded file. If you do not explicitly specify a path in your application code, an exception is thrown when a user attempts to upload a file. This behavior helps keep the files on the server secure by preventing users from being able to write to arbitrary locations in your application's directory structure, as well as preventing access to sensitive root directories. - - The method writes the uploaded file to the specified directory. Therefore, the ASP.NET application must have write access to the directory on the server. There are two ways that the application can get write access. You can explicitly grant write access to the account under which the application is running, in the directory in which the uploaded files will be saved. Alternatively, you can increase the level of trust that is granted to the ASP.NET application. To get write access to the executing directory for the application, the application must be granted the object with the trust level set to the value. Increasing the level of trust increases the application's access to resources on the server. Note that this is not a secure approach, because a malicious user who gains control of your application will also be able to run under this higher level of trust. It is a best practice to run an ASP.NET application in the context of a user with the minimum privileges that are required for the application to run. For more information about security in ASP.NET applications, see [Basic Security Practices for Web Applications](https://learn.microsoft.com/previous-versions/aspnet/zdh19h94(v=vs.100)) and [ASP.NET Trust Levels and Policy Files](https://msdn.microsoft.com/library/f897c794-10d3-414c-86b7-59b66564bbf1). - - -## Memory Limitations - One way to guard against denial of service attacks is to limit the size of the files that can be uploaded by using the control. You should set a size limit that is appropriate for the types of files that you expect to be uploaded. The default size limit is 4096 kilobytes (KB), or 4 megabytes (MB). You can allow larger files to be uploaded by setting the `maxRequestLength` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element. To increase the maximum allowable file size for the entire application, set the `maxRequestLength` attribute in the Web.config file. To increase the maximum allowable file size for a specified page, set the `maxRequestLength` attribute inside the `location` element in Web.config. For an example, see [location Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/b6x6shw7(v=vs.100)). - - When uploading large files, a user might also receive the following error message: - - `aspnet_wp.exe (PID: 1520) was recycled because memory consumption exceeded 460 MB (60 percent of available RAM).` - - If your users encounter this error message, increase the value of the `memoryLimit` attribute in the [processModel](https://msdn.microsoft.com/library/4b8fe20e-74c8-4566-b72c-ce5f83c8e32d) of element the Web.config file for the application. The `memoryLimit` attribute specifies the maximum amount of memory that a worker process can use. If the worker process exceeds the `memoryLimit` amount, a new process is created to replace it, and all current requests are reassigned to the new process. - - To control whether the file to upload is temporarily stored in memory or on the server while the request is being processed, set the `requestLengthDiskThreshold` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element. This attribute enables you to manage the size of the input stream buffer. The default is 256 bytes. The value that you specify should not exceed the value that you specify for the `maxRequestLength` attribute. - - -## Using the FileUpload Control with the UpdatePanel Control - The control is designed to be used only in postback scenarios and not in asynchronous postback scenarios during partial-page rendering. When you use a control inside an control, the file must be uploaded by using a control that is a object for the panel. controls are used to update selected regions of a page instead of updating the whole page with a postback. For more information, see [UpdatePanel Control Overview](https://learn.microsoft.com/previous-versions/aspnet/bb386454(v=vs.100)) and [Partial-Page Rendering Overview](https://learn.microsoft.com/previous-versions/aspnet/bb386573(v=vs.100)). - - -## 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=191897). - - This section contains the following four examples: - -- The first example demonstrates how to create a control that saves files to a path that is specified in code. - -- The second example demonstrates how to create a control that saves files to a specified directory in the file system for the application. - -- The third example demonstrates how to create a control that saves files to a specified path and limits the size of the file that can be uploaded. - -- The fourth example demonstrates how to create a control that saves files to a specified path and allows only files that have the .doc or .xls file name extensions to be uploaded. - + +## Introduction + The class displays a text box control and a browse button that enable users to select a file on the client and upload it to the Web server. The user specifies the file to upload by entering the full path of the file on the local computer (for example, **C:\MyFiles\TestFile.txt**) in the text box of the control. Alternately, the user can select the file by clicking the **Browse** button, and then locating it in the **Choose File** dialog box. + + Use the property to get the name of a file on a client to upload by using the control. The file name that this property returns does not include the path of the file on the client. + + The property gets a object that points to a file to upload. Use this property to access the contents of the file as bytes. For example, you can use the object that is returned by the property to read the contents of the file as bytes and store them in a byte array. Alternatively, you can use the property to retrieve all the bytes in the file. + + The property gets the underlying object for the file to upload. You can use this property to access additional properties on the file. The property gets the length of the file. The property gets the MIME content type of the file. In addition, you can use the property to access the property, the property, and the method. However, the same functionality is provided by the property, the property, and the method. + + +## Saving Uploaded Files + The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. The code that you write to save the specified file should call the method, which saves the contents of a file to a specified path on the server. Typically, the method is called in an event-handling method for an event that raises a post back to the server. For example, if you provide a button to submit a file, you could include the code to save the file inside the event-handling method for the click event. + + Before calling the method to save the file to the server, use the property to verify that the control contains a file. If the returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. Do not check the property to determine whether a file to upload exists because, by default, this property contains 0 bytes. As a result, even when the control is blank, the property returns a non-null value. + + +## Security Considerations + When you call the method, you must specify the full path of the directory in which to save the uploaded file. If you do not explicitly specify a path in your application code, an exception is thrown when a user attempts to upload a file. This behavior helps keep the files on the server secure by preventing users from being able to write to arbitrary locations in your application's directory structure, as well as preventing access to sensitive root directories. + + The method writes the uploaded file to the specified directory. Therefore, the ASP.NET application must have write access to the directory on the server. There are two ways that the application can get write access. You can explicitly grant write access to the account under which the application is running, in the directory in which the uploaded files will be saved. Alternatively, you can increase the level of trust that is granted to the ASP.NET application. To get write access to the executing directory for the application, the application must be granted the object with the trust level set to the value. Increasing the level of trust increases the application's access to resources on the server. Note that this is not a secure approach, because a malicious user who gains control of your application will also be able to run under this higher level of trust. It is a best practice to run an ASP.NET application in the context of a user with the minimum privileges that are required for the application to run. For more information about security in ASP.NET applications, see [Basic Security Practices for Web Applications](https://learn.microsoft.com/previous-versions/aspnet/zdh19h94(v=vs.100)) and [ASP.NET Trust Levels and Policy Files](https://msdn.microsoft.com/library/f897c794-10d3-414c-86b7-59b66564bbf1). + + +## Memory Limitations + One way to guard against denial of service attacks is to limit the size of the files that can be uploaded by using the control. You should set a size limit that is appropriate for the types of files that you expect to be uploaded. The default size limit is 4096 kilobytes (KB), or 4 megabytes (MB). You can allow larger files to be uploaded by setting the `maxRequestLength` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element. To increase the maximum allowable file size for the entire application, set the `maxRequestLength` attribute in the Web.config file. To increase the maximum allowable file size for a specified page, set the `maxRequestLength` attribute inside the `location` element in Web.config. For an example, see [location Element (ASP.NET Settings Schema)](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/b6x6shw7(v=vs.100)). + + When uploading large files, a user might also receive the following error message: + + `aspnet_wp.exe (PID: 1520) was recycled because memory consumption exceeded 460 MB (60 percent of available RAM).` + + If your users encounter this error message, increase the value of the `memoryLimit` attribute in the [processModel](https://msdn.microsoft.com/library/4b8fe20e-74c8-4566-b72c-ce5f83c8e32d) of element the Web.config file for the application. The `memoryLimit` attribute specifies the maximum amount of memory that a worker process can use. If the worker process exceeds the `memoryLimit` amount, a new process is created to replace it, and all current requests are reassigned to the new process. + + To control whether the file to upload is temporarily stored in memory or on the server while the request is being processed, set the `requestLengthDiskThreshold` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element. This attribute enables you to manage the size of the input stream buffer. The default is 256 bytes. The value that you specify should not exceed the value that you specify for the `maxRequestLength` attribute. + + +## Using the FileUpload Control with the UpdatePanel Control + The control is designed to be used only in postback scenarios and not in asynchronous postback scenarios during partial-page rendering. When you use a control inside an control, the file must be uploaded by using a control that is a object for the panel. controls are used to update selected regions of a page instead of updating the whole page with a postback. For more information, see [UpdatePanel Control Overview](https://learn.microsoft.com/previous-versions/aspnet/bb386454(v=vs.100)) and [Partial-Page Rendering Overview](https://learn.microsoft.com/previous-versions/aspnet/bb386573(v=vs.100)). + + +## Declarative Syntax + +```xml + +``` + + + +## Examples + A Visual Studio Web site project with source code is available to accompany this topic: [Download](https://go.microsoft.com/fwlink/?LinkId=191897). + + This section contains the following four examples: + +- The first example demonstrates how to create a control that saves files to a path that is specified in code. + +- The second example demonstrates how to create a control that saves files to a specified directory in the file system for the application. + +- The third example demonstrates how to create a control that saves files to a specified path and limits the size of the file that can be uploaded. + +- The fourth example demonstrates how to create a control that saves files to a specified path and allows only files that have the .doc or .xls file name extensions to be uploaded. + > [!CAUTION] -> These examples demonstrate the basic syntax for the control, but they do not demonstrate all the necessary error checking that should be completed before to saving the file. For a more complete example, see . - - The following example demonstrates how to create a control that saves files to a path that is specified in code. The method is called to save the file to the specified path on the server. - +> These examples demonstrate the basic syntax for the control, but they do not demonstrate all the necessary error checking that should be completed before to saving the file. For a more complete example, see . + + The following example demonstrates how to create a control that saves files to a path that is specified in code. The method is called to save the file to the specified path on the server. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadClass1/cs/fileuploadclass1cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass1/VB/fileuploadclass1vb.aspx" id="Snippet1"::: - - The following example demonstrates how to create a control that saves files to a specified directory in the file system for the application. The property is used to get the physical file system path of the root directory for the currently executing server application. The method is called to save the file to the specified path on the server. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass1/VB/fileuploadclass1vb.aspx" id="Snippet1"::: + + The following example demonstrates how to create a control that saves files to a specified directory in the file system for the application. The property is used to get the physical file system path of the root directory for the currently executing server application. The method is called to save the file to the specified path on the server. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadClass2/cs/fileuploadclass2cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass2/VB/fileuploadclass2vb.aspx" id="Snippet1"::: - - The following example demonstrates how to create a control that saves files to a path that is specified in the code. The control limits the size of the file that can be uploaded to 2 MB. The property is used to access the underlying property and return the size of the file. If the size of the file to upload is less than 2 MB, the method is called to save the file to the specified path on the server. In addition to checking for the maximum file size setting in your application code, you can set the `maxRequestLength` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element to a maximum allowable size in the configuration file for your application. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass2/VB/fileuploadclass2vb.aspx" id="Snippet1"::: + + The following example demonstrates how to create a control that saves files to a path that is specified in the code. The control limits the size of the file that can be uploaded to 2 MB. The property is used to access the underlying property and return the size of the file. If the size of the file to upload is less than 2 MB, the method is called to save the file to the specified path on the server. In addition to checking for the maximum file size setting in your application code, you can set the `maxRequestLength` attribute of the [httpRuntime](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/e1f13641(v=vs.100)) element to a maximum allowable size in the configuration file for your application. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadClass3/cs/fileuploadclass3cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass3/VB/fileuploadclass3vb.aspx" id="Snippet1"::: - - The following example demonstrates how to create a control that saves files to a path that is specified in the code. This example allows only files that have the .doc or .xls file name extensions to be uploaded. The method is called to return the extension of the file to upload. If the file has a .doc or .xls file name extension, the method is called to save the file to the specified path on the server. - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass3/VB/fileuploadclass3vb.aspx" id="Snippet1"::: + + The following example demonstrates how to create a control that saves files to a path that is specified in the code. This example allows only files that have the .doc or .xls file name extensions to be uploaded. The method is called to return the extension of the file to upload. If the file has a .doc or .xls file name extension, the method is called to save the file to the specified path on the server. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadClass4/cs/fileuploadclass4cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass4/VB/fileuploadclass4vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass4/VB/fileuploadclass4vb.aspx" id="Snippet1"::: + ]]> @@ -191,20 +191,20 @@ Initializes a new instance of the class. - constructor to initialize a new instance of the class. The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. - - - -## Examples - The following example demonstrates how to initialize a new instance of the class. Note that this example demonstrates the constructor syntax but does not add functionality to the control after it is created. - - This example is part of a larger example provided for the class. - - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadCstr/VB/fileuploadcstrvb.aspx" id="Snippet1"::: - + constructor to initialize a new instance of the class. The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. + + + +## Examples + The following example demonstrates how to initialize a new instance of the class. Note that this example demonstrates the constructor syntax but does not add functionality to the control after it is created. + + This example is part of a larger example provided for the class. + + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadCstr/VB/fileuploadcstrvb.aspx" id="Snippet1"::: + ]]> @@ -232,11 +232,11 @@ An that represents the output stream to render HTML content on the client. Adds the HTML attributes and styles of a control to render to the specified object. - method is primarily used by control developers to insert the appropriate attributes and styles to the output stream for a control. The method overrides the method. - + method is primarily used by control developers to insert the appropriate attributes and styles to the output stream for a control. The method overrides the method. + ]]> @@ -309,21 +309,21 @@ Gets an array of the bytes in a file that is specified by using a control. A array that contains the contents of the specified file. - control does not automatically read the file from the client. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user can click to upload the file. The code that you write to save the specified file could call the property, which returns the contents of the file. - - Before calling the property, you should use the property to verify that the control contains a file to upload. If the returns `true`, call the property. If it returns `false`, display a message to the user indicating that the control does not contain a file. If you do not provide error-handling code to verify that a file exists, an attempt to save a nonexistent file throws an exception. - - - -## Examples - The following example demonstrates how to create a control. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. This example uses the property to upload the entire file. - + control does not automatically read the file from the client. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user can click to upload the file. The code that you write to save the specified file could call the property, which returns the contents of the file. + + Before calling the property, you should use the property to verify that the control contains a file to upload. If the returns `true`, call the property. If it returns `false`, display a message to the user indicating that the control does not contain a file. If you do not provide error-handling code to verify that a file exists, an attempt to save a nonexistent file throws an exception. + + + +## Examples + The following example demonstrates how to create a control. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. This example uses the property to upload the entire file. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadFileBytes/CS/FileUploadFileBytesCS.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadFileBytes/VB/FileUploadFileBytesVB.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadFileBytes/VB/FileUploadFileBytesVB.aspx" id="Snippet1"::: + ]]> The entire file was not read. @@ -360,19 +360,19 @@ Gets a object that points to a file to upload using the control. A that points to a file to upload using the . - property gets a object that points to a file to upload by using the control. Use the property to access the contents of the file. For example, you can use the object that is returned by this property to read the contents of the file as bytes and store them in a byte array. - - - -## Examples - The following example demonstrates how to create a control. The property is used to read the contents of the file into a byte array. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. - + property gets a object that points to a file to upload by using the control. Use the property to access the contents of the file. For example, you can use the object that is returned by this property to read the contents of the file as bytes and store them in a byte array. + + + +## Examples + The following example demonstrates how to create a control. The property is used to read the contents of the file into a byte array. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUpload.FileContent/cs/fileupload.filecontentcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.FileContent/VB/fileupload.filecontentvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.FileContent/VB/fileupload.filecontentvb.aspx" id="Snippet1"::: + ]]> @@ -409,19 +409,19 @@ Gets the name of a file on a client to upload using the control. A string that specifies the name of a file on a client to upload using the . - control. The file name that the property returns does not include the path of the file on the client. - - - -## Examples - The following example demonstrates how to create a control that saves files to a path that is specified in code. The property is used to get the name of the file to upload. The method is called to save the file to the specified path on the server, using the same name the file has on the client. Note that this example demonstrates the basic syntax for this control, but does not demonstrate all the necessary error checking that should be done before saving the file. For a more complete example, see . - + control. The file name that the property returns does not include the path of the file on the client. + + + +## Examples + The following example demonstrates how to create a control that saves files to a path that is specified in code. The property is used to get the name of the file to upload. The method is called to save the file to the specified path on the server, using the same name the file has on the client. Note that this example demonstrates the basic syntax for this control, but does not demonstrate all the necessary error checking that should be done before saving the file. For a more complete example, see . + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUploadClass1/cs/fileuploadclass1cs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass1/VB/fileuploadclass1vb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUploadClass1/VB/fileuploadclass1vb.aspx" id="Snippet1"::: + ]]> @@ -458,19 +458,19 @@ if the contains a file; otherwise, . - property gets a value indicating whether the control contains a file to upload. Use this property to verify that a file to upload exists before performing operations on the file. For example, before calling the method to save the file to disk, use the property to verify that the file exists. If returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. - - - -## Examples - The following example demonstrates how to create a control that performs error checking. Before saving the file, the method is called to verify that the control contains a file to upload. In addition, the method is called to check whether a file with the same name already occurs in the path. If it does, the name of the file to upload is prefixed with an underscore character before the method is called. This prevents the existing file from being overwritten. - + property gets a value indicating whether the control contains a file to upload. Use this property to verify that a file to upload exists before performing operations on the file. For example, before calling the method to save the file to disk, use the property to verify that the file exists. If returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. + + + +## Examples + The following example demonstrates how to create a control that performs error checking. Before saving the file, the method is called to verify that the control contains a file to upload. In addition, the method is called to check whether a file with the same name already occurs in the path. If it does, the name of the file to upload is prefixed with an underscore character before the method is called. This prevents the existing file from being overwritten. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUpload.SaveAs/cs/fileupload.saveascs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.SaveAs/VB/fileupload.saveasvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.SaveAs/VB/fileupload.saveasvb.aspx" id="Snippet1"::: + ]]> @@ -506,11 +506,11 @@ if any files have been uploaded; otherwise, . - @@ -538,11 +538,11 @@ An object that contains the event data. Raises the event for the control. - method notifies the control to perform any necessary pre-rendering steps before saving view state and rendering content. - + method notifies the control to perform any necessary pre-rendering steps before saving view state and rendering content. + ]]> @@ -577,21 +577,21 @@ Gets the underlying object for a file that is uploaded by using the control. An for a file uploaded by using the . - property gets the underlying object for a file that is uploaded by using the control. Use this property to access additional properties on the uploaded file. - - You can use the property to get the length of the file. You can use the property to get the MIME content type of the file. In addition, you can use the property to access the property, the property, and the method. However, the same functionality is provided by the property, the property, and the method. - - - -## Examples - The following example demonstrates how to create a control. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. This example uses the property to access the property. The property is used to determine the length of the file before copying the file contents to a byte array. - + property gets the underlying object for a file that is uploaded by using the control. Use this property to access additional properties on the uploaded file. + + You can use the property to get the length of the file. You can use the property to get the MIME content type of the file. In addition, you can use the property to access the property, the property, and the method. However, the same functionality is provided by the property, the property, and the method. + + + +## Examples + The following example demonstrates how to create a control. When the user clicks the **Upload file** button, the contents of the file are displayed as bytes in a text box on the page. This example uses the property to access the property. The property is used to determine the length of the file before copying the file contents to a byte array. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUpload.FileContent/cs/fileupload.filecontentcs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.FileContent/VB/fileupload.filecontentvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.FileContent/VB/fileupload.filecontentvb.aspx" id="Snippet1"::: + ]]> @@ -651,11 +651,11 @@ The object that receives the control content. Sends the control content to the specified object, which writes the content to render on the client. - method sends the control content to the specified object, which writes the content to render on the client. - + method sends the control content to the specified object, which writes the content to render on the client. + ]]> @@ -684,27 +684,27 @@ A string that specifies the full path of the location of the server on which to save the uploaded file. Saves the contents of an uploaded file to a specified path on the Web server. - method saves the contents of an uploaded file to a specified path on the Web server. - - The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. The code that you write to save the specified file should call the method, which saves the contents of a file to a specified path on the server. Typically, the method is called in an event-handling method for an event that raises a post back to the server. For example, if you provide a button to submit a file, the code to save the file to the server could then be included inside the event-handling method for the click event. - - When you call the method, you must specify the full path of the directory on the server in which to save the uploaded file. If you do not explicitly specify a path in your application code, an exception is thrown when a user attempts to upload a file. This behavior helps keep the files on the server secure, by not allowing users to specify a path in which to save the files that they upload. - - Before calling the method, you should use the property to verify that the control contains a file to upload. If the returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. If you do not provide error-handling code to verify that a file exists, an attempt to save a nonexistent file throws an exception. - - For a call to the to work, the ASP.NET application must have write access to the directory on the server. There are two ways that the application can get write access. You can explicitly grant write access to the account under which the application is running, in the directory in which the uploaded files will be saved. Alternatively, you can increase the level of trust that is granted to the ASP.NET application. To get write access to the executing directory for the application, the application must be granted the object with the trust level set to the value. Increasing the level of trust increases the application's access to resources on the server. Note that this is not a secure approach, because a malicious user who gains control of your application will also be able to run under this higher level of trust. It is a best practice to run an ASP.NET application in the context of a user who has the minimum privileges that are required for the application to run. For more information about security in ASP.NET applications, see [Basic Security Practices for Web Applications](https://learn.microsoft.com/previous-versions/aspnet/zdh19h94(v=vs.100)) and [ASP.NET Trust Levels and Policy Files](https://msdn.microsoft.com/library/f897c794-10d3-414c-86b7-59b66564bbf1). - - - -## Examples - The following example demonstrates how to create a control that performs error checking. Before the file is saved, the method is called to verify that a file to upload exists. In addition, the method is called to check whether a file that has the same name already exists in the path. If it does, the name of the file to upload is prefixed with a number before the method is called. This prevents the existing file from being overwritten. - + method saves the contents of an uploaded file to a specified path on the Web server. + + The control does not automatically save a file to the server after the user selects the file to upload. You must explicitly provide a control or mechanism to allow the user to submit the specified file. For example, you can provide a button that the user clicks to upload the file. The code that you write to save the specified file should call the method, which saves the contents of a file to a specified path on the server. Typically, the method is called in an event-handling method for an event that raises a post back to the server. For example, if you provide a button to submit a file, the code to save the file to the server could then be included inside the event-handling method for the click event. + + When you call the method, you must specify the full path of the directory on the server in which to save the uploaded file. If you do not explicitly specify a path in your application code, an exception is thrown when a user attempts to upload a file. This behavior helps keep the files on the server secure, by not allowing users to specify a path in which to save the files that they upload. + + Before calling the method, you should use the property to verify that the control contains a file to upload. If the returns `true`, call the method. If it returns `false`, display a message to the user indicating that the control does not contain a file. If you do not provide error-handling code to verify that a file exists, an attempt to save a nonexistent file throws an exception. + + For a call to the to work, the ASP.NET application must have write access to the directory on the server. There are two ways that the application can get write access. You can explicitly grant write access to the account under which the application is running, in the directory in which the uploaded files will be saved. Alternatively, you can increase the level of trust that is granted to the ASP.NET application. To get write access to the executing directory for the application, the application must be granted the object with the trust level set to the value. Increasing the level of trust increases the application's access to resources on the server. Note that this is not a secure approach, because a malicious user who gains control of your application will also be able to run under this higher level of trust. It is a best practice to run an ASP.NET application in the context of a user who has the minimum privileges that are required for the application to run. For more information about security in ASP.NET applications, see [Basic Security Practices for Web Applications](https://learn.microsoft.com/previous-versions/aspnet/zdh19h94(v=vs.100)) and [ASP.NET Trust Levels and Policy Files](https://msdn.microsoft.com/library/f897c794-10d3-414c-86b7-59b66564bbf1). + + + +## Examples + The following example demonstrates how to create a control that performs error checking. Before the file is saved, the method is called to verify that a file to upload exists. In addition, the method is called to check whether a file that has the same name already exists in the path. If it does, the name of the file to upload is prefixed with a number before the method is called. This prevents the existing file from being overwritten. + :::code language="aspx-csharp" source="~/snippets/csharp/VS_Snippets_WebNet/FileUpload.SaveAs/cs/fileupload.saveascs.aspx" id="Snippet1"::: - :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.SaveAs/VB/fileupload.saveasvb.aspx" id="Snippet1"::: - + :::code language="aspx-vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/FileUpload.SaveAs/VB/fileupload.saveasvb.aspx" id="Snippet1"::: + ]]> diff --git a/xml/System.Web.UI.WebControls/FormView.xml b/xml/System.Web.UI.WebControls/FormView.xml index fbdaa9b207e..86d7cfded5d 100644 --- a/xml/System.Web.UI.WebControls/FormView.xml +++ b/xml/System.Web.UI.WebControls/FormView.xml @@ -206,131 +206,131 @@ ## Declarative Syntax -``` +```xml -         + -         -         -         -         + + + + -         -         -         + + + -         -         -         + + + -         -         + + -         -         -         + + + -         -         -         -         + NextPageImageUrl="uri" + NextPageText="string" + OnPropertyChanged="PropertyChanged event handler" + PageButtonCount="integer" + Position="Bottom|Top|TopAndBottom" + PreviousPageImageUrl="uri" + PreviousPageText="string" + Visible="True|False" + /> + + -         -         + + ``` diff --git a/xml/System.Web.UI.WebControls/GridView.xml b/xml/System.Web.UI.WebControls/GridView.xml index 47b2bd1c825..7517b19062a 100644 --- a/xml/System.Web.UI.WebControls/GridView.xml +++ b/xml/System.Web.UI.WebControls/GridView.xml @@ -234,332 +234,332 @@ ## Declarative Syntax -``` +```xml -         -         -                 + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                         -                         -                         -                         -                 -                 + + + + + -                             -                             -                             -                             -                         + + + + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                         + + -                         -                 -         -         -         -         + + + + + + -         -         -         -         -         -         + NextPageImageUrl="uri" + NextPageText="string" + OnPropertyChanged="PropertyChanged event handler" + PageButtonCount="integer" + Position="Bottom|Top|TopAndBottom" + PreviousPageImageUrl="uri" + PreviousPageText="string" + Visible="True|False" + /> + + -         -         -         + + + ``` diff --git a/xml/System.Web.UI.WebControls/HiddenField.xml b/xml/System.Web.UI.WebControls/HiddenField.xml index 868a3005c2d..5fe21593a70 100644 --- a/xml/System.Web.UI.WebControls/HiddenField.xml +++ b/xml/System.Web.UI.WebControls/HiddenField.xml @@ -79,22 +79,22 @@ ## Declarative Syntax -``` +```xml ``` diff --git a/xml/System.Web.UI.WebControls/HotSpot.xml b/xml/System.Web.UI.WebControls/HotSpot.xml index e5249552752..aea3b1387a5 100644 --- a/xml/System.Web.UI.WebControls/HotSpot.xml +++ b/xml/System.Web.UI.WebControls/HotSpot.xml @@ -280,7 +280,7 @@ To create an inactive area within an active hot spot, you must specify the inactive hot spot before the active hot spot in the control. For example, the following defines an active ring by specifying an inactive circular hot spot within a larger active circular hot spot: -``` +```xml diff --git a/xml/System.Web.UI.WebControls/Label.xml b/xml/System.Web.UI.WebControls/Label.xml index 27502422f8f..d37b2ddfe1c 100644 --- a/xml/System.Web.UI.WebControls/Label.xml +++ b/xml/System.Web.UI.WebControls/Label.xml @@ -104,44 +104,44 @@ ## Declarative Syntax -``` +```xml ``` diff --git a/xml/System.Web.UI.WebControls/LinkButton.xml b/xml/System.Web.UI.WebControls/LinkButton.xml index 9c1a8b72b18..9a737a7777e 100644 --- a/xml/System.Web.UI.WebControls/LinkButton.xml +++ b/xml/System.Web.UI.WebControls/LinkButton.xml @@ -114,51 +114,51 @@ ## Declarative Syntax -``` +```xml ``` @@ -911,7 +911,7 @@ > [!IMPORTANT] > When performing a cross-page postback with controls with server-side validation, you should check that the page's property is `true` before processing the postback. In the case of a cross-page postback, the page to check is the PreviousPage. The following Visual Basic code shows how this is done: -``` +```vb Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.PreviousPage.IsValid Then ' Handle the post back diff --git a/xml/System.Web.UI.WebControls/ListView.xml b/xml/System.Web.UI.WebControls/ListView.xml index 5e96a3ef60d..0211fd8358f 100644 --- a/xml/System.Web.UI.WebControls/ListView.xml +++ b/xml/System.Web.UI.WebControls/ListView.xml @@ -222,86 +222,86 @@ ## Declarative Syntax -``` +```xml -         -             -         -         -             -         -         -             -         -         -             -         -         -             -         -         -             -         -         -             -         -         -             -         -         -             -         -         -                 -         -         -             -         + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ``` @@ -4139,7 +4139,7 @@ The following example shows how to use the control without defining a template in the control. A server control with a known ID is also not specified. -``` +```xml <% Eval("LastName")%> diff --git a/xml/System.Web.UI.WebControls/Literal.xml b/xml/System.Web.UI.WebControls/Literal.xml index 2014c246ad0..87ffcd45990 100644 --- a/xml/System.Web.UI.WebControls/Literal.xml +++ b/xml/System.Web.UI.WebControls/Literal.xml @@ -78,22 +78,22 @@ ## Declarative Syntax -``` +```xml ``` diff --git a/xml/System.Web.UI.WebControls/Login.xml b/xml/System.Web.UI.WebControls/Login.xml index 1cf31621678..b4d55c5ebdd 100644 --- a/xml/System.Web.UI.WebControls/Login.xml +++ b/xml/System.Web.UI.WebControls/Login.xml @@ -137,89 +137,89 @@ ## Declarative Syntax -``` +```xml -         -         -         -         -         -         + + + + + + -         -         -         -         -         + + + + + ``` diff --git a/xml/System.Web.UI.WebControls/ObjectDataSource.xml b/xml/System.Web.UI.WebControls/ObjectDataSource.xml index eb1b7a2300d..d690bdbd086 100644 --- a/xml/System.Web.UI.WebControls/ObjectDataSource.xml +++ b/xml/System.Web.UI.WebControls/ObjectDataSource.xml @@ -139,448 +139,448 @@ ## Declarative Syntax -``` +```xml -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         + /> + ``` diff --git a/xml/System.Web.UI.WebControls/PasswordRecovery.xml b/xml/System.Web.UI.WebControls/PasswordRecovery.xml index a796c11b676..fefb25a4114 100644 --- a/xml/System.Web.UI.WebControls/PasswordRecovery.xml +++ b/xml/System.Web.UI.WebControls/PasswordRecovery.xml @@ -146,112 +146,112 @@ ## Declarative Syntax -``` +```xml -         -         -         -         -         + + + + -                 -                         -                 -         -         + + + + + -         -         -         + + + -         -         -         -         -         + + + + + -         -         + + ``` diff --git a/xml/System.Web.UI.WebControls/RadioButtonList.xml b/xml/System.Web.UI.WebControls/RadioButtonList.xml index 05c13210b1a..017a614ad8c 100644 --- a/xml/System.Web.UI.WebControls/RadioButtonList.xml +++ b/xml/System.Web.UI.WebControls/RadioButtonList.xml @@ -71,70 +71,70 @@ ## Declarative Syntax -``` +```xml -             + ``` diff --git a/xml/System.Web.UI.WebControls/SiteMapPath.xml b/xml/System.Web.UI.WebControls/SiteMapPath.xml index 00014166aa2..ff96a8a3a5a 100644 --- a/xml/System.Web.UI.WebControls/SiteMapPath.xml +++ b/xml/System.Web.UI.WebControls/SiteMapPath.xml @@ -98,68 +98,68 @@ ## Declarative Syntax -``` +```xml -         -         + + -         -         -         + + + -         -         -         + + + -         -         -         + + + -         + ``` @@ -173,7 +173,7 @@ The previous example uses the default site map provider and a Web.sitemap file with the following structure. -``` +```xml diff --git a/xml/System.Web.UI.WebControls/SqlDataSource.xml b/xml/System.Web.UI.WebControls/SqlDataSource.xml index 94e478cc838..244c92f35d0 100644 --- a/xml/System.Web.UI.WebControls/SqlDataSource.xml +++ b/xml/System.Web.UI.WebControls/SqlDataSource.xml @@ -123,448 +123,448 @@ ## Declarative Syntax -``` +```xml -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         -         -                 -                 -                 -                 -                 -                 -                 -         + /> + ``` diff --git a/xml/System.Web.UI.WebControls/Style.xml b/xml/System.Web.UI.WebControls/Style.xml index 4c562a2f3cb..1f9dcc1ab52 100644 --- a/xml/System.Web.UI.WebControls/Style.xml +++ b/xml/System.Web.UI.WebControls/Style.xml @@ -621,13 +621,13 @@ For example, suppose you have the following Web server control declaration: -``` +```xml ``` The following HTML is rendered on the client for the previous Web server control declaration: -``` +```html ``` diff --git a/xml/System.Web.UI.WebControls/Table.xml b/xml/System.Web.UI.WebControls/Table.xml index 6a02c5daa80..dcd0a9be7d1 100644 --- a/xml/System.Web.UI.WebControls/Table.xml +++ b/xml/System.Web.UI.WebControls/Table.xml @@ -85,455 +85,455 @@ ## Declarative Syntax -``` +```xml -             -                         -                         + -             -             + + -                         -                         + -             -             + + -                         -                         + -             + ID="string" + OnDataBinding="DataBinding event handler" + OnDisposed="Disposed event handler" + OnInit="Init event handler" + OnLoad="Load event handler" + OnPreRender="PreRender event handler" + OnUnload="Unload event handler" + RowSpan="integer" + runat="server" + Scope="NotSet|Row|Column" + SkinID="string" + Style="string" + TabIndex="integer" + Text="string" + ToolTip="string" + VerticalAlign="NotSet|Top|Middle|Bottom" + Visible="True|False" + Width="size" + Wrap="True|False" + /> + ``` diff --git a/xml/System.Web.UI.WebControls/TextBox.xml b/xml/System.Web.UI.WebControls/TextBox.xml index 30714308062..b85e2e7bd36 100644 --- a/xml/System.Web.UI.WebControls/TextBox.xml +++ b/xml/System.Web.UI.WebControls/TextBox.xml @@ -112,60 +112,60 @@ ## Declarative Syntax -``` +```xml ``` @@ -1548,12 +1548,10 @@ The following example shows how you can use this event to respond to changes in the control. The code displays the contents of the property of a TextBox control (called TextBox1) in a label (called Label1) when the `Text` property is changed. User input in a Web Forms page can include potentially malicious client script. By default, the Web Forms page validates that user input does not include script or HTML elements. For more information, see [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)). ```vb - Protected Sub TextBox1_TextChanged(ByVal sender As Object, _ ByVal e As System.EventArgs) Handles TextBox1.TextChanged Label1.Text = Server.HtmlEncode(TextBox1.Text) End Sub - ``` ```csharp @@ -1561,7 +1559,6 @@ protected void TextBox1_TextChanged(object sender, EventArgs e) { Label1.Text = Server.HtmlEncode(TextBox1.Text); } - ``` ]]> diff --git a/xml/System.Web.UI.WebControls/TreeView.xml b/xml/System.Web.UI.WebControls/TreeView.xml index 0311b04e9b0..21bd6075597 100644 --- a/xml/System.Web.UI.WebControls/TreeView.xml +++ b/xml/System.Web.UI.WebControls/TreeView.xml @@ -206,270 +206,270 @@ ## Declarative Syntax -``` +```xml -         -                 -         -         -         + + + -         -                 + + -         -         -                 + + + -                 -         -         -         + -         + -         + + Font-Strikeout="True|False" + Font-Underline="True|False" + ForeColor="color name|#dddddd" + Height="size" + HorizontalPadding="size" + ImageUrl="uri" + NodeSpacing="size" + OnDisposed="Disposed event handler" + VerticalPadding="size" + Width="size" + /> ``` @@ -509,7 +509,7 @@ The following code example provides sample XML data for the preceding example. -``` +```xml
@@ -531,7 +531,7 @@ The following code example provides sample site map data for the preceding code example. -``` +```xml @@ -608,7 +608,7 @@ The following code example provides sample XML data for the preceding example. -``` +```xml
@@ -716,7 +716,7 @@ The following code example provides sample site map data for the preceding example. -``` +```xml @@ -1120,7 +1120,7 @@ The following code example provides sample XML data for the preceding example. -``` +```xml
@@ -1198,7 +1198,7 @@ The following code example provides sample XML data for the preceding code example. -``` +```xml
@@ -1998,7 +1998,7 @@ The following code example provides sample XML data for the preceding code example. -``` +```xml
@@ -4197,7 +4197,7 @@ Note: Check your browser documentation to determine if the
diff --git a/xml/System.Web.UI.WebControls/WebControl.xml b/xml/System.Web.UI.WebControls/WebControl.xml index 5b686daa694..86adfbb31eb 100644 --- a/xml/System.Web.UI.WebControls/WebControl.xml +++ b/xml/System.Web.UI.WebControls/WebControl.xml @@ -937,13 +937,13 @@ For example, suppose you have the following Web server control declaration: -``` +```xml ``` The following HTML is rendered on the client for the previous Web server control declaration: -``` +```html ``` diff --git a/xml/System.Web.UI.WebControls/Wizard.xml b/xml/System.Web.UI.WebControls/Wizard.xml index 48893729fd9..4d2873f059c 100644 --- a/xml/System.Web.UI.WebControls/Wizard.xml +++ b/xml/System.Web.UI.WebControls/Wizard.xml @@ -145,151 +145,151 @@ ## Declarative Syntax -``` +```xml -         -         -         + + + -         -         -         -         + + + + -         -         -         -         -         -         + + + + + + -         -         + + -         -         -         + + + -         -         -         -         -         -                 + + + + + -                         + -                         -                         + + -                         -                 -                 -         + + + + ``` @@ -3488,7 +3488,7 @@ ## Examples The following example shows how to add a control to the `SideBarTemplate` element and how to use a control to navigate the steps. -``` +```xml diff --git a/xml/System.Web.UI/ChtmlTextWriter.xml b/xml/System.Web.UI/ChtmlTextWriter.xml index 97d6ad70303..df1edfc09ec 100644 --- a/xml/System.Web.UI/ChtmlTextWriter.xml +++ b/xml/System.Web.UI/ChtmlTextWriter.xml @@ -511,7 +511,7 @@ 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. -``` +```xml diff --git a/xml/System.Web.UI/ClientIDMode.xml b/xml/System.Web.UI/ClientIDMode.xml index 249fd93ab2e..3dafb05b79f 100644 --- a/xml/System.Web.UI/ClientIDMode.xml +++ b/xml/System.Web.UI/ClientIDMode.xml @@ -15,32 +15,32 @@ Specifies how ASP.NET generates the for a control that can be accessed in client script. - enumeration when you set the property for a control. The value that you assign to the property determines how the property is generated. The value of the property is rendered as the `id` attribute in markup, and it is the value that you use to access the control from client script. The value that you assign to the property does not affect the property of the server control, only the `id` attribute of the corresponding HTML element. - - The default value of for a page is Predictable. The default value of for a control is Inherit. - - Because the default for controls is Inherit, the default generation mode is Predictable. (However, if you use Visual Studio to convert a Web project to ASP.NET 4 from an earlier version, Visual Studio automatically sets the site default to AutoID in the Web.config file.) - - You can set the `ClientIDMode` value for all pages in a Web site by setting the [pages](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/950xf363(v=vs.100)) element in the site's Web.config file. You can set the `ClientIDMode` value for a page in the [@ Page](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ydy4x04a(v=vs.100)) directive. - - For more information, see [ASP.NET Web Server Control Identification](https://learn.microsoft.com/previous-versions/1d04y8ss(v=vs.140)). - - - -## Examples - The following example shows controls that are contained in a control. On the control, the property is set to Predictable and the property is set to `ProductID`. From client script, you can access a particular instance of a based on the `ProductID` value of the instance that you are trying to access. - - This example creates HTML with three `ProductIDLabel` controls. When the page runs, the IDs for the controls will be the following: - + enumeration when you set the property for a control. The value that you assign to the property determines how the property is generated. The value of the property is rendered as the `id` attribute in markup, and it is the value that you use to access the control from client script. The value that you assign to the property does not affect the property of the server control, only the `id` attribute of the corresponding HTML element. + + The default value of for a page is Predictable. The default value of for a control is Inherit. + + Because the default for controls is Inherit, the default generation mode is Predictable. (However, if you use Visual Studio to convert a Web project to ASP.NET 4 from an earlier version, Visual Studio automatically sets the site default to AutoID in the Web.config file.) + + You can set the `ClientIDMode` value for all pages in a Web site by setting the [pages](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/950xf363(v=vs.100)) element in the site's Web.config file. You can set the `ClientIDMode` value for a page in the [@ Page](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ydy4x04a(v=vs.100)) directive. + + For more information, see [ASP.NET Web Server Control Identification](https://learn.microsoft.com/previous-versions/1d04y8ss(v=vs.140)). + + + +## Examples + The following example shows controls that are contained in a control. On the control, the property is set to Predictable and the property is set to `ProductID`. From client script, you can access a particular instance of a based on the `ProductID` value of the instance that you are trying to access. + + This example creates HTML with three `ProductIDLabel` controls. When the page runs, the IDs for the controls will be the following: + - `ListView1_ProductIDLabel_1` - `ListView1_ProductIDLabel_34` - `ListView1_ProductIDLabel_43` :::code language="aspx-csharp" source="~/snippets/common/VS_Snippets_WebNet/system.web.ui.clientidmode/common/predictable.aspx" id="Snippet11"::: - + ]]> diff --git a/xml/System.Web.UI/Control.xml b/xml/System.Web.UI/Control.xml index d7a66142600..b6d1eb9f88d 100644 --- a/xml/System.Web.UI/Control.xml +++ b/xml/System.Web.UI/Control.xml @@ -726,7 +726,7 @@ This property gathers the information necessary about a page's UI hierarchy and ## Remarks When a Web server control is rendered as an HTML element, the `id` attribute of the HTML element is set to the value of the property. The value is often used to access the HTML element in client script by using the `document.getElementById` method. The ID is also often used in CSS rules to specify elements to style. For example, the following CSS style rule selects all `span` elements that have the `id` attribute value of `ProductIDLabel` and sets their `background-color` attribute to `white`: -``` +```txt span#ProductIDLabel { background-color: white; } ``` diff --git a/xml/System.Web.UI/ScriptReferenceBase.xml b/xml/System.Web.UI/ScriptReferenceBase.xml index 94f2328e711..49f4a16b5cc 100644 --- a/xml/System.Web.UI/ScriptReferenceBase.xml +++ b/xml/System.Web.UI/ScriptReferenceBase.xml @@ -182,7 +182,7 @@ If you reference a standalone script file that is not embedded in an assembly, you must include code at the end of the script file to call the [Sys.Application.notifyScriptLoaded](https://msdn.microsoft.com/library/dd95aa94-34bb-45b6-ac06-1cb4031469c6) method. The following example shows the code to include at the end of the script file. -``` +```javascript if(typeof(Sys) !== "undefined) Sys.Application.notifyScriptLoaded(); ``` diff --git a/xml/System.Web/HttpContext.xml b/xml/System.Web/HttpContext.xml index 7871534957a..2ce56fcfe80 100644 --- a/xml/System.Web/HttpContext.xml +++ b/xml/System.Web/HttpContext.xml @@ -509,7 +509,6 @@ Next ' Clear the exceptions so ASP.NET won't handle them. context.ClearError() End Sub - ``` ]]> @@ -1697,7 +1696,6 @@ city = (string)(Session["City"]); HttpContext context = HttpContext.Current; context.Session["FirstName"] = firstName; firstName = (string)(context.Session["FirstName"]); - ``` ```vb @@ -1719,7 +1717,6 @@ city = DirectCast(Session("City"), String) Dim context As HttpContext = HttpContext.Current context.Session("FirstName") = firstName firstName = DirectCast(context.Session("FirstName"), String) - ``` ]]> diff --git a/xml/System.Web/HttpRequest.xml b/xml/System.Web/HttpRequest.xml index 4673785ca66..38430bf7411 100644 --- a/xml/System.Web/HttpRequest.xml +++ b/xml/System.Web/HttpRequest.xml @@ -1792,7 +1792,6 @@ No object is defined for the request.