Blazor Hub Does not Connect Across Entire MVC App - asp.net-core-mvc

I upgraded an ASP.NET Core 2.2 MVC project to 3.0 in order to use a Blazor component in one of the views of the application. After setting up Blazor in the MVC project and running it, the Blazor hub connects just fine as shown in the browser console screenshot below:
but when I navigate to the page that contains the blazor component or another page besides the index page for that matter, I get this:
As shown in the screenshot, it includes the name of the controller the url that negotiates for a websocket connection and throws a 404. If this is not a bug, how can I fix this to work on every view of the application or the view that contains my component to say the least?

What I needed to do was to set the app base path in shared.chtml and Boom! Problem Solved.

Related

Switching between views in Ionic2 is too slow

I'm building an Ionic application, I have built 50% of the project, and at first I used the sidemenu template that is auto generated with ionic start MyProject sidemenu, and then I added my own pages and components after that.
In the browser view the app was great, then I deployed my application to an android device, with the deployment being successfully When I start the application I felt that the application was slow, but when I switch to a some view, it took 5-10 seconds to open the new page.
I watched the traffic between the server side and the application, and observed that the application is not switching to the new page until the request is back and the view is rendered!
any help?
Try switching to your views first and then using the ionViewWillEnter() or another built in ionic API for the application lifecycle.
ionViewWillEnter will pull the data everytime the view loads, where
ionViewDidLoad will pull the page on first load only.
ionViewDidLoad() {
console.log('ionViewDidLoad SplashPage');
}
You do not state which version of ionic you are using but in ionic 3 if you create your pages with the terminal using
ionic g page MyPage
It will automatically create the page as a module. This allows for lazy loading. You can read more on it here form ionic's official blog post.
Its hard to say exactly why the view is only loading after it hits the server as you have not added your navigational code. There could be a code block that waits for a server response before pushing to the next page.
If your view is depended on received data from the server then your request should be in a new Promise allowing you to add conditionals for before and/or after the data has been touched.

MVC 5 ajax not working in default project

i have created a default MVC 5 project. i used Entity Framework 6. I created a simple person class with Id and Name as a model. Then i generated CRUD operation for it using MVC 5 template after running the code first migration. i implemented a delete functionality everything is working fine.
but when i copied the same code other MVC project. but this project contains some additional css and js. whenever i click on delete or any other operation page is posting back. i want to know why it is happening and why default project has every thing enabled with Ajax.
what i am missing in this project
To enable ajax helpers:
Install-Package microsoft.jQuery.Unobtrusive.Ajax

Common silverlight object for all web pages

In my web project I want to have global silverlight control (music player) common for all web pages in my project. When user click in hyperlink(want change view in web app) I dont want refresh all view with silverlight control but only part of view. Some think like in grooveshark.com. I think that for all views in my project I use PartialViews and load them using ajax(its good idea? Maybe anyone have better idea?) but I have problem. If we call action not from ajax but we write adress in web browser I get only partial view without shared layout. Also after load partial view with ajax and after them click back in browser I have updated adress in browser but not updated view(view not render).
Most important for me it's to have global silverlight object for all pages in my project and during the change view don't reload silverlight control.
Any ideas how do this?

MVC3 to MVC4 upgrade issue

I've updated my MVC3 site to use MVC4 today and have come across a problem. When navigating to a particular url (the url for an MVC area) I get this messaage in Firefox
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
This used to work with MVC4. Chrome still does work with MVC4.
Any ideas?

How to get Orbeon Forms embedded into an ASP.Net MVC3 app?

Background
I'm investigating the use of Orbeon Forms to integrate into our
ASP.NET MVC3 web app by building a simple MVC3 app to figure stuff
out.
I have a Win2008 R2 std server running Tomcat 7 and Orbeon 3.9.1 PE
trial on our HyperV server. This is working and I can create forms and
then use the forms to submit data.
I've created an empty MVC3 app on my local dev machine. It has an
Index action on the Home controller that returns a page that has a
bunch of links to the add new URLs of some of my forms on the Orbeon
installation. The links access an Add action on the Home controller
which uses a WebRequest object with the ?orebeon-embeddable=true
querystring parameter tagged on the end to get the definition of the
Orbeon submit form page. I replace the relative URLs in what I get
back to make them absolute. I then insert that into a basic view and
display it.
Problems
HOWEVER! As soon as I do interact with the Orbeon form in anyway, e.g. click inside a single line textbox field (IE9) I get a JS error
in the script file "orbeon-[random guid style value].js" line 121 with
the line "AjaxServer.exceptionWhenTalkingToServer(e,formID)"
highlighted with the error being "formID is undefined".
I'm not sure where to start looking here as I am unfamiliar with
Tomcat and only know what I can decipher from the Orbeon docs.
Anybody tried to embed the form runner like this and experience this
error?
What I tried next
[Update]: The MVC Json() method got me thinking that perhaps the
Orbeon test site I set up on the VM did not like the fact it was
getting AJAX requests from the MVC app on my dev machine. With this in
mind I tried installing the CORS filter into the Orbeon app from
dzhuvinov.com. According to the docs after adding the relevant
config to the web.xml file the default behaviour is to pretty
unrestrictive, i.e. it should let everything through. Unfortunately
after restrating Tomcat this didn't help.
[Update 2]: Okay seems like the CORS docs are a bit out of date and
the defaults are seemingly the opposite so setting the initial values
for that seems to sort that out somewhat - although IE9 still gets the
JS error message. Meanwhile in FireFox 12 things are going better but
now the issue is how to pass the JSESSIONID cookie Orbeon sends me
back when I embed the runner in the MVC view such that when you
trigger any of the AJAX on the Orbeon form it sends the JSESSIONID
cookie as well.
Well I guess my title and info were slightly misleading so I may as well close my own question with the follow "answer".
In order to embed in an MVC3 app (read as any non-Java backend I would imagine) Orbeon Forms Runner and have it work I had to do the following:
Configure the CORS filter for my install of Orbeon Forms on Tomcat 7 (Dzhuvinov.com) to allow cross-domain AJAX.
In HTML partial's returned from Orbeon make relative URLs beginning /orbeon/xforms-server/ absolute calls to a custom proxy. Store the JSESSIONID in the ASP.NET MVC Session object.
Write controller actions for the proxy to handle requests. This simple proxy forward requests on to the Orbeon Forms install after setting the JSESSIONID cookie with the value stored in (2).

Resources