Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use asp:MenuItem NavigateUrl property to call BlazorServer app in the same solution? I have a solution. Solution has different projects with diff framework such as .net 4.6.1 and Core .3.1. Inside the .net 4.6.1 web app project, I would like to call the Blazor server app(EDBBlazorServer) project. Could you please tell me how to do this?

I have tried this line, it will not work.
ASP.NET
<asp:MenuItem NavigateUrl="/EDBBlazorServer/_Host" Text="MyLinktoBlazorServerLandingPage" />

Please help

What I have tried:

ASP.NET
<pre> <asp:MenuItem NavigateUrl="/EDBBlazorServer/_Host" Text="MyLinktoBlazorServerLandingPage" />
I tried
ASP.NET
<asp:MenuItem NavigateUrl="localhost:44320" Text="MyLinktoBlazorServerLandingPage" />
it didn't work also. Do you have any idea how I can call the blazor server app?
Posted
Updated 2-Sep-20 23:14pm
v2

1 solution

You need to specify the URL of the page you want to open.

If the two applications are hosted in the same server (eg: localhost:44320), the URL can be relative.

Otherwise, you will need to use an absolute URL - for example: http://localhost:44320/EDBBlazorServer/_Host

We can't tell you the precise URL to use, since we don't know the URL of the page you're trying to load.
 
Share this answer
 
Comments
bgundas 3-Sep-20 8:49am    
<asp:menuitem navigateurl="http://localhost:44320/EDBBlazorServer/_Host" text="RollUp Mappings">
hello, this is not working,

This site can’t be reached localhost refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

I am getting this page. Everything is connected I am online. I am still getting this above error.
Richard Deeming 3-Sep-20 8:53am    
As I said, you need to use the correct URL for the page you're trying to navigate to.

If you're running the solution from Visual Studio, you'll also need to make sure that both projects are running.
bgundas 3-Sep-20 11:06am    
I created a sample blazor server app inside a solution where there is also a .net frame work app. Nothing special, just the scaffolding code.

I am with visiting any page inside blazor app. index.razor or _Host.cshtml.

how can I redirect to this page(\EDBBlazorServer\Pages\Index.razor) from the webforms app(4.6.1)


this doesn't work
http://localhost:44320/EDBBlazorServer/_Host

How can i run two apps at once, my webforms app starts running after f5, then how do i get the blazor app also running?
Richard Deeming 3-Sep-20 11:08am    
Once again: Use the full URL of the page you're trying to redirect to. And make sure both projects are running.
bgundas 3-Sep-20 11:12am    
I appreciate your help Richard,
How can i run two apps at once, my web forms app starts running after f5, then how do i get the blazor app also running?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900