Replies: 10 comments
-
@agriffard I guess you can't reach to
builder.Services.AddOrchardCms()
.ConfigureServices(svc=> {
svc.AddServerSideBlazor();
svc.AddSingleton<WeatherForecastService>();
})
.Configure((a,b,c)=>{
b.MapBlazorHub();
a.UseStaticFiles();
b.MapFallbackToAreaPage("/_Host", "Zord.App");
}); |
Beta Was this translation helpful? Give feedback.
-
@ns8482e I made the change you suggested but this error is returned:
|
Beta Was this translation helpful? Give feedback.
-
I believe you don't have OC's default tenant setup yet that's why you are getting this error |
Beta Was this translation helpful? Give feedback.
-
FallBack to |
Beta Was this translation helpful? Give feedback.
-
Thank you @ns8482e. I commented |
Beta Was this translation helpful? Give feedback.
-
I defined a When I create two pages and want to switch between the corresponding two links that I added in the NavMenu, the content is not reloaded (it works if I click on another Razor page and go to the second page). Not sure how I can force a page to reload. |
Beta Was this translation helpful? Give feedback.
-
Blazer server application is SPA application. Only part of app is server rendered via signalr |
Beta Was this translation helpful? Give feedback.
-
@agriffard I guess I understood your question now, just looked at your code use parameter set method instead of initialize to see page content changes. Blazor doesn't recreate component and initialize only gets called once. |
Beta Was this translation helpful? Give feedback.
-
Thank you @ns8482e. I also figured it out in the mean time, by using the |
Beta Was this translation helpful? Give feedback.
-
Maybe I came late, but |
Beta Was this translation helpful? Give feedback.
-
I am trying to find out if their is a chance to use IOrchardHelper in a .razor page of a Blazor Server app.
I created a simple test app (https://github.com/agriffard/Zord), referenced the OC CMS targets package and added
builder.Services.AddOrchardCms();
in Program.cs.I could not add
app.UseOrchardCore();
because it was leading to anArgumentException: Value cannot be null or empty. (Parameter 'areaName')
in ModularTenantRouterMiddleware so I commented it.At this point, the app is not redirected to /setup OC page on loading or responding to this url.
When I add a Page.razor with a directive
@page "/page/{alias}"
, inject aIOrchardHelper
and use it to load a content by its alias, there is aNullReferenceException: Object reference not set to an instance of an object.
in _Host.cshtml on:<component type="typeof(App)" render-mode="ServerPrerendered" />.
Is this a dead end to think that it is possible to use OC in a Blazor application?
Beta Was this translation helpful? Give feedback.
All reactions