TryReact

Добавлен проект демонстрации системы обработки маршрутов

6/24/2019 1:33:53 AM

Details

.gitignore 4(+4 -0)

diff --git a/.gitignore b/.gitignore
index 18d39c1..a19b8e2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,7 @@ TryReact/TryWebPack/bin/
 TryReact/TryWebPack/obj/
 TryReact/TryWebPack/node_modules/
 TryReact/TryWebPack/public/
+
+
+TryReact/TryRoute/bin/
+TryReact/TryRoute/obj/
diff --git a/TryReact/TryReact.sln b/TryReact/TryReact.sln
index bcc5642..bb7e3cd 100644
--- a/TryReact/TryReact.sln
+++ b/TryReact/TryReact.sln
@@ -9,6 +9,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TryBabel", "TryBabel\TryBab
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TryWebPack", "TryWebPack\TryWebPack.csproj", "{EE8962E1-C7A2-4116-9BFE-778A4700C497}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TryRoute", "TryRoute\TryRoute.csproj", "{09876834-42FF-45B2-B855-D6B8693C301F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,10 @@ Global
 		{EE8962E1-C7A2-4116-9BFE-778A4700C497}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{EE8962E1-C7A2-4116-9BFE-778A4700C497}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{EE8962E1-C7A2-4116-9BFE-778A4700C497}.Release|Any CPU.Build.0 = Release|Any CPU
+		{09876834-42FF-45B2-B855-D6B8693C301F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{09876834-42FF-45B2-B855-D6B8693C301F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{09876834-42FF-45B2-B855-D6B8693C301F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{09876834-42FF-45B2-B855-D6B8693C301F}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/TryReact/TryRoute/index.html b/TryReact/TryRoute/index.html
new file mode 100644
index 0000000..4a28f13
--- /dev/null
+++ b/TryReact/TryRoute/index.html
@@ -0,0 +1,166 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8" />
+    <title>Маршруты в React</title>
+</head>
+<body>
+    <div id="app"></div>
+
+    <script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
+    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
+    <script src="https://unpkg.com/react-router-dom/umd/react-router-dom.min.js"></script>
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.25.0/babel.min.js"></script>
+
+    <script type="text/babel">
+        const Router = ReactRouterDOM.BrowserRouter;
+        const Route = ReactRouterDOM.Route;
+        const Switch = ReactRouterDOM.Switch;
+        const Link = ReactRouterDOM.Link;
+        const Redirect = ReactRouterDOM.Redirect;
+            
+        class About extends React.Component{
+            render(){
+                return <h2>О сайте</h2>;
+            }
+        }
+        class NotFound extends React.Component{
+            render(){
+                return <h2>Ресурс не найден</h2>;
+            }
+        }
+
+
+        class ProductView1 extends React.Component{
+            render(){
+                // получаем параметры
+                const id= this.props.match.params.id;
+                const name = this.props.match.params.name;
+                return <h2>id: {id}  Name: {name}</h2>;
+            }
+        }
+        class Old extends React.Component{
+            render(){
+                return <Redirect to={`/ProductView1/${this.props.match.params.id}/${this.props.match.params.name}`} />;
+            }
+        }
+
+        class ProductLinks extends React.Component{
+            
+            constructor(props){
+                super(props);
+
+                this.state = { 
+                    Items:
+                    [
+                        {id: 1, name: "Item1"}, 
+                        {id: 2, name: "Item2"}, 
+                        {id: 3, name: "Item3"} 
+                    ]
+                }
+
+            }
+            
+            render(){
+                return (<div>
+                            <p><Link to="/ProductView1/1/Name1">P1</Link></p>
+                            <p><Link to="/ProductView1/Name1-1">P1 other</Link></p>
+                            <p><Link to="/ProductView1/Number/Name1">P1 BadLink</Link></p>
+                            <p><Link to="/ProductView1/2/Name2">P2</Link></p>
+                            <p><Link to="/Old/2/Name2">Redirect P2</Link></p>
+
+                            <hr />
+                            {
+                                this.state.Items.map(function(item){
+                                    return <p><Link to={`/ProductView1/${item.id}/${item.name}`}>{item.name}</Link></p>;                                                
+                                })
+                            }
+                        </div>
+                );
+            }
+        }
+
+
+        class Main extends React.Component{
+            render(){
+                return <h2>Главная</h2>;
+            }
+        }
+
+        class Header extends React.Component{
+            render(){
+                return (<div>
+                            <p>Header</p>
+                            <table>
+                                <tr>
+                                    <td><Link to="/">Main</Link></td>
+                                    <td><Link to="/About">About</Link></td>
+                                    <td><Link to="/ProductLinks">ProductLinks</Link></td>
+                                    <Link to="/old">Redirect</Link>
+
+                                    <td><Link to="/unknow">BadLinkExample</Link></td>
+                                </tr>
+                            </table>
+                        </div>
+                );
+            }
+
+        }
+        class Footer extends React.Component{            
+            render(){              
+                return (<div>
+                            <p>Footer</p>
+                            <p>Creat by cccc1808</p>
+                            <hr />
+                            <p>Match: {JSON.stringify(this.props.match)}</p>
+                            <p>Location {JSON.stringify(this.props.location)}</p>
+                        </div>
+                );
+            }
+        }
+
+
+        class MainLayout extends React.Component{           
+            render(){
+                console.log(this.props.match);
+                console.log(this.props.location);
+
+                return (<div>
+                            <Header />
+                            <hr />
+
+                            <Switch>
+                                <Route exact path="/" component={Main} />
+                                <Route path="/About" component={About} />
+
+                                <Route path="/ProductLinks" component={ProductLinks} />
+                                <Route path="/ProductView1/:id(\d+)/:name" component={ProductView1} />
+                                <Route path="/ProductView1/:name-:id" component={ProductView1} />
+                                <Route path="/Old/:id(\d+)/:name" component={Old} />
+                                
+                                <Redirect from="/old" to="/About" />
+
+                                <Route component={NotFound} />
+                            </Switch>
+
+                            <hr />
+                            <Footer match={this.props.match} location={this.props.location}/>
+                        </div>
+                );
+            }
+        }
+
+
+
+
+        ReactDOM.render(
+            <Router>
+                <Switch>
+                    <Route path="/" component={MainLayout} />                    
+                </Switch>
+            </Router>,
+            document.getElementById("app")
+        )
+        </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/TryReact/TryRoute/packages.config b/TryReact/TryRoute/packages.config
new file mode 100644
index 0000000..da1b654
--- /dev/null
+++ b/TryReact/TryRoute/packages.config
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+  <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.0" targetFramework="net45" />
+</packages>
\ No newline at end of file
diff --git a/TryReact/TryRoute/Properties/AssemblyInfo.cs b/TryReact/TryRoute/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..b9e2fa3
--- /dev/null
+++ b/TryReact/TryRoute/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Управление общими сведениями о сборке осуществляется с помощью 
+// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
+// связанных с этой сборкой.
+[assembly: AssemblyTitle("TryRoute")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("TryRoute")]
+[assembly: AssemblyCopyright("Copyright ©  2019")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Установка значения false в параметре ComVisible делает типы в этой сборке невидимыми 
+// для компонентов COM. Если требуется обратиться к типу в этой сборке через 
+// COM, задайте атрибуту ComVisible значение true для требуемого типа.
+[assembly: ComVisible(false)]
+
+// Следующий GUID служит для идентификации библиотеки типов typelib, если этот проект видим для COM
+[assembly: Guid("09876834-42ff-45b2-b855-d6b8693c301f")]
+
+// Сведения о версии сборки состоят из указанных ниже четырех значений:
+//
+//      основной номер версии;
+//      дополнительный номер версии;
+//      номер сборки;
+//      редакция.
+//
+// Можно задать все значения или принять номер сборки и номер редакции по умолчанию, 
+// используя "*", как показано ниже:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/TryReact/TryRoute/TryRoute.csproj b/TryReact/TryRoute/TryRoute.csproj
new file mode 100644
index 0000000..b706846
--- /dev/null
+++ b/TryReact/TryRoute/TryRoute.csproj
@@ -0,0 +1,123 @@
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>
+    </ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{09876834-42FF-45B2-B855-D6B8693C301F}</ProjectGuid>
+    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>TryRoute</RootNamespace>
+    <AssemblyName>TryRoute</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <UseIISExpress>true</UseIISExpress>
+    <Use64BitIISExpress />
+    <IISExpressSSLPort />
+    <IISExpressAnonymousAuthentication />
+    <IISExpressWindowsAuthentication />
+    <IISExpressUseClassicPipelineMode />
+    <UseGlobalApplicationHostFile />
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Web.DynamicData" />
+    <Reference Include="System.Web.Entity" />
+    <Reference Include="System.Web.ApplicationServices" />
+    <Reference Include="System.ComponentModel.DataAnnotations" />
+    <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml" />
+    <Reference Include="System.Configuration" />
+    <Reference Include="System.Web.Services" />
+    <Reference Include="System.EnterpriseServices" />
+  </ItemGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform">
+      <HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="index.html" />
+    <Content Include="Web.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="packages.config" />
+    <None Include="Web.Debug.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+    <None Include="Web.Release.config">
+      <DependentUpon>Web.config</DependentUpon>
+    </None>
+  </ItemGroup>
+  <PropertyGroup>
+    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+  </PropertyGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
+  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <UseIIS>True</UseIIS>
+          <AutoAssignPort>True</AutoAssignPort>
+          <DevelopmentServerPort>18435</DevelopmentServerPort>
+          <DevelopmentServerVPath>/</DevelopmentServerVPath>
+          <IISUrl>http://localhost:18435/</IISUrl>
+          <NTLMAuthentication>False</NTLMAuthentication>
+          <UseCustomServer>False</UseCustomServer>
+          <CustomServerUrl>
+          </CustomServerUrl>
+          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+  <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+    <PropertyGroup>
+      <ErrorText>Данный проект ссылается на пакеты NuGet, отсутствующие на этом компьютере. Используйте восстановление пакетов NuGet, чтобы скачать их.  Дополнительную информацию см. по адресу: http://go.microsoft.com/fwlink/?LinkID=322105. Отсутствует следующий файл: {0}.</ErrorText>
+    </PropertyGroup>
+    <Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\build\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
+  </Target>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file
diff --git a/TryReact/TryRoute/TryRoute.csproj.user b/TryReact/TryRoute/TryRoute.csproj.user
new file mode 100644
index 0000000..ca0d73e
--- /dev/null
+++ b/TryReact/TryRoute/TryRoute.csproj.user
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <UseIISExpress>true</UseIISExpress>
+    <Use64BitIISExpress />
+    <IISExpressSSLPort />
+    <IISExpressAnonymousAuthentication />
+    <IISExpressWindowsAuthentication />
+    <IISExpressUseClassicPipelineMode />
+    <UseGlobalApplicationHostFile />
+    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
+  </PropertyGroup>
+  <ProjectExtensions>
+    <VisualStudio>
+      <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+        <WebProjectProperties>
+          <StartPageUrl>
+          </StartPageUrl>
+          <StartAction>CurrentPage</StartAction>
+          <AspNetDebugging>True</AspNetDebugging>
+          <SilverlightDebugging>False</SilverlightDebugging>
+          <NativeDebugging>False</NativeDebugging>
+          <SQLDebugging>False</SQLDebugging>
+          <ExternalProgram>
+          </ExternalProgram>
+          <StartExternalURL>
+          </StartExternalURL>
+          <StartCmdLineArguments>
+          </StartCmdLineArguments>
+          <StartWorkingDirectory>
+          </StartWorkingDirectory>
+          <EnableENC>True</EnableENC>
+          <AlwaysStartWebServerOnDebug>True</AlwaysStartWebServerOnDebug>
+        </WebProjectProperties>
+      </FlavorProperties>
+    </VisualStudio>
+  </ProjectExtensions>
+</Project>
\ No newline at end of file
diff --git a/TryReact/TryRoute/Web.config b/TryReact/TryRoute/Web.config
new file mode 100644
index 0000000..4cd752a
--- /dev/null
+++ b/TryReact/TryRoute/Web.config
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--
+  Дополнительные сведения о настройке приложения ASP.NET см. на странице
+  https://go.microsoft.com/fwlink/?LinkId=169433.
+  -->
+<configuration>
+  <system.web>
+    <compilation debug="true" targetFramework="4.5"/>
+    <httpRuntime targetFramework="4.5"/>
+  </system.web>
+  <system.codedom>
+    <compilers>
+      <compiler language="c#;cs;csharp" extension=".cs"
+        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
+        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
+      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
+        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
+        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
+    </compilers>
+  </system.codedom>
+
+</configuration>
diff --git a/TryReact/TryRoute/Web.Debug.config b/TryReact/TryRoute/Web.Debug.config
new file mode 100644
index 0000000..246977a
--- /dev/null
+++ b/TryReact/TryRoute/Web.Debug.config
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Дополнительные сведения об использовании преобразования web.config см. на странице https://go.microsoft.com/fwlink/?LinkId=125889. -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+  <!--
+    В следующем примере преобразование "SetAttributes" будет изменять значение
+    "connectionString" с целью использования "ReleaseSQLServer", только когда
+    указатель "Match" находит атрибут "name", который имеет значение "MyDB".
+    
+    <connectionStrings>
+      <add name="MyDB"
+        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+    </connectionStrings>
+  -->
+  <system.web>
+    <!--
+      
+      В следующем пример преобразование "Replace" будет заменять весь 
+      раздел <customErrors> в файле web.config.
+      Заметьте, поскольку имеется только один раздел customErrors в узле 
+      <system.web>, не требуется использовать атрибут "xdt:Locator".
+      
+      <customErrors defaultRedirect="GenericError.htm"
+        mode="RemoteOnly" xdt:Transform="Replace">
+        <error statusCode="500" redirect="InternalError.htm"/>
+      </customErrors>
+    -->
+  </system.web>
+</configuration>
\ No newline at end of file
diff --git a/TryReact/TryRoute/Web.Release.config b/TryReact/TryRoute/Web.Release.config
new file mode 100644
index 0000000..3a1668e
--- /dev/null
+++ b/TryReact/TryRoute/Web.Release.config
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Дополнительные сведения об использовании преобразования web.config см. на странице https://go.microsoft.com/fwlink/?LinkId=125889. -->
+
+<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
+  <!--
+    В следующем примере преобразование "SetAttributes" будет изменять значение
+    "connectionString" с целью использования "ReleaseSQLServer", только когда
+    указатель "Match" находит атрибут "name", который имеет значение "MyDB".
+    
+    <connectionStrings>
+      <add name="MyDB"
+        connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
+        xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
+    </connectionStrings>
+  -->
+  <system.web>
+    <compilation xdt:Transform="RemoveAttributes(debug)" />
+    <!--
+      
+      В следующем пример преобразование "Replace" будет заменять весь 
+      раздел <customErrors> в файле web.config.
+      Заметьте, поскольку имеется только один раздел customErrors в узле 
+      <system.web>, не требуется использовать атрибут "xdt:Locator".
+      
+      <customErrors defaultRedirect="GenericError.htm"
+        mode="RemoteOnly" xdt:Transform="Replace">
+        <error statusCode="500" redirect="InternalError.htm"/>
+      </customErrors>
+    -->
+  </system.web>
+</configuration>
\ No newline at end of file