Skip to content

Commit da61cc0

Browse files
Andrew JankAndrew Jank
Andrew Jank
authored and
Andrew Jank
committed
downgraded web forms to 4.7.2
added hello world component to blazor to replicate other sample
1 parent 1123168 commit da61cc0

File tree

9 files changed

+27
-16
lines changed

9 files changed

+27
-16
lines changed

samples/WebFormsToBlazorWithSession/BlazorSessionCore/AxdContraint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Globalization;
22
using System.Text.RegularExpressions;
33

4-
namespace BlazorSessionCore.Components
4+
namespace BlazorSessionCore
55
{
66
internal sealed class AxdContraint : IRouteConstraint
77
{

samples/WebFormsToBlazorWithSession/BlazorSessionCore/BlazorSessionCore.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10+
<PackageReference Include="Microsoft.AspNetCore.Components.CustomElements" Version="8.0.0" />
1011
<PackageReference Include="Yarp.ReverseProxy" Version="2.1.0" />
1112
</ItemGroup>
1213

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<h3>HelloWorld from ASP.NET Core</h3>
2+
3+
Current path: @Path
4+
5+
@code {
6+
[Parameter]
7+
public string Path { get; set; } = "no-route";
8+
}

samples/WebFormsToBlazorWithSession/BlazorSessionCore/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
using BlazorSessionCore;
12
using BlazorSessionCore.Components;
3+
using Microsoft.AspNetCore.Components.Web;
24

35
var builder = WebApplication.CreateBuilder(args);
46

@@ -22,7 +24,7 @@
2224

2325
// Add services to the container.
2426
builder.Services.AddRazorComponents()
25-
.AddInteractiveServerComponents();
27+
.AddInteractiveServerComponents(options => options.RootComponents.RegisterCustomElement<HelloWorld>("hello-world"));
2628

2729
var app = builder.Build();
2830

@@ -46,6 +48,7 @@
4648

4749
app.MapForwarder("/Scripts/{**catch-all}", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);
4850
app.MapForwarder("/Content/{**catch-all}", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);
51+
app.MapForwarder("/bundles/{**catch-all}", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);
4952
app.MapForwarder("/About", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);
5053
app.MapForwarder("/Contact", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);
5154
app.MapForwarder("/{route:isAxdFile}", app.Configuration["ProxyTo"]).Add(static builder => ((RouteEndpointBuilder)builder).Order = int.MaxValue);

samples/WebFormsToBlazorWithSession/WebFormsSessionFramework/Global.asax.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ void Application_Start(object sender, EventArgs e)
1818
RouteConfig.RegisterRoutes(RouteTable.Routes);
1919
BundleConfig.RegisterBundles(BundleTable.Bundles);
2020
SystemWebAdapterConfiguration.AddSystemWebAdapters(this)
21+
.AddProxySupport(options => options.UseForwardedHeaders = true)
2122
.AddJsonSessionSerializer(options =>
2223
{
2324
options.RegisterKey<string>("test-value");

samples/WebFormsToBlazorWithSession/WebFormsSessionFramework/Site.Master

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebFormsSessionFramework.SiteMaster" %>
1+
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebFormsSessionFramework.SiteMaster" %>
22

33
<!DOCTYPE html>
44

@@ -7,6 +7,7 @@
77
<meta charset="utf-8" />
88
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
99
<title><%: Page.Title %> - My ASP.NET Application</title>
10+
<base href="/" />
1011

1112
<asp:PlaceHolder runat="server">
1213
<%: Scripts.Render("~/bundles/modernizr") %>
@@ -54,6 +55,7 @@
5455
</div>
5556
</nav>
5657
<div class="container body-content">
58+
<hello-world path="<%: Context.Request.Path %>"></hello-world>
5759
<asp:ContentPlaceHolder ID="MainContent" runat="server">
5860
</asp:ContentPlaceHolder>
5961
<hr />
@@ -64,6 +66,8 @@
6466
</form>
6567
<asp:PlaceHolder runat="server">
6668
<%: Scripts.Render("~/Scripts/bootstrap.js") %>
67-
</asp:PlaceHolder>
69+
</asp:PlaceHolder>=
70+
71+
<script src="_framework/blazor.server.js"></script>
6872
</body>
6973
</html>

samples/WebFormsToBlazorWithSession/WebFormsSessionFramework/Site.Master.designer.cs

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/WebFormsToBlazorWithSession/WebFormsSessionFramework/Web.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<add key="RemoteAppApiKey" value="2874B6C1-AB0F-4108-898A-4B4B85EF4972"/>
1818
</appSettings>
1919
<system.web>
20-
<compilation debug="true" targetFramework="4.8"/>
20+
<compilation debug="true" targetFramework="4.7.2"/>
2121
<httpRuntime targetFramework="4.7.2"/>
2222
<pages>
2323
<namespaces>
@@ -68,4 +68,4 @@
6868
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
6969
</handlers>
7070
</system.webServer>
71-
</configuration>
71+
</configuration>

samples/WebFormsToBlazorWithSession/WebFormsSessionFramework/WebFormsSessionFramework.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<AppDesignerFolder>Properties</AppDesignerFolder>
1515
<RootNamespace>WebFormsSessionFramework</RootNamespace>
1616
<AssemblyName>WebFormsSessionFramework</AssemblyName>
17-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
17+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
1818
<UseIISExpress>true</UseIISExpress>
1919
<Use64BitIISExpress />
2020
<IISExpressSSLPort>44397</IISExpressSSLPort>
@@ -49,8 +49,10 @@
4949
<Reference Include="System.ComponentModel.DataAnnotations" />
5050
<Reference Include="System" />
5151
<Reference Include="System.Data" />
52+
<Reference Include="System.Data.DataSetExtensions" />
5253
<Reference Include="System.Drawing" />
5354
<Reference Include="System.Web" />
55+
<Reference Include="System.Web.Extensions" />
5456
<Reference Include="System.Xml" />
5557
<Reference Include="System.Configuration" />
5658
<Reference Include="System.Web.Services" />
@@ -77,6 +79,7 @@
7779
<Reference Include="Newtonsoft.Json">
7880
<HintPath>..\..\..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
7981
</Reference>
82+
<Reference Include="System.Xml.Linq" />
8083
<Reference Include="WebGrease">
8184
<Private>True</Private>
8285
<HintPath>..\..\..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>

0 commit comments

Comments
 (0)