Angular 8 and asp.net mvc routing is not working - asp.net-mvc

I am new to the Angular 8 with asp.net mvc.
Facing issue with routing,
(1) Application home url: http://localhost/dashboard
it has all details with some model numbers in bootstrap table, when click on model number with group name it will route to https://localhost/dashboard details?Groupname=xyz&ModelNo=2300 this works fine.
(2) At this stage everything is good but when refresh the browser error is getting displaying
as,
This localhost page can't be found
No webpage was found for the web address https://localhost/dashboard details?Groupname=xyz&ModelNo=2300
HTTP ERROR 404
What I tried
(1) added location strategy and hash strategy- didn't worked
when added this on refresh IIS windows was getting displayed.
(2) used url rewrite same error displayed HTTP ERROR 404.
Need assistance to solve this problem

Got the solution by spending almost 3 days, need to change base href,
Got the hint from
https://github.com/angular/angular/issues/11046.

Related

Grails URL Mapping - if URL doesn't match fall back to application root page

I am working on my first Grails + Spring Boot appcation along with React JS to build a single page application.
The landing page is index.gsp
I am facing little trouble with UrlMappings.
What I want to achieve is, if url doesn't start with /api/** or /assets/** then it should be redirected to / (root - index.gsp).
As of now, it is giving me 403, forbidden error, if i refresh my single page application.
Do let me know if you need any other information.
Regards,
Priyank Thakkar
Well, I figured it out.
In my URLMappings.groovy, I had to enter
"/**"(view:"/index")
at end of the file after all the mappings are done.

Error loading backoffice content tree in umbraco

My umbraco backoffice application is not loading the content tree all of the sudden. I can't figure what I would have done to make this stop working.
When I open backoffice, a request to the following URL is failing
umbraco/UmbracoTrees/ApplicationTree/GetApplicationTrees?application=content&tree=&isDialog=false
This is the message that's coming back:
)]}',
{"tree.String":"A value is required but was not present in the request."}
I don't have a lot to work with here... I've tried deleting cookies and rebuilding the app but I'm not having any luck. I really need to get this working ASAP...
I figured out what the problem was...
I added a filter to the HttpConfiguration on start up and it make BackOffice quit working. The filter simply validated any models passed to WebAPI. Oh well, I don't really have time to look into anymore so I'm just not going to use the filter...

Recaptcha giving 404 error on Validate in SSL site

In my ASP.NET MVC 4 project, I am using the Microsoft.Web.Helpers (from the NuGet package) and my code is a very basic implementation of ReCaptcha. In my view I have:
#ReCaptcha.GetHtml(theme: "clean")
In my controller I have:
Microsoft.Web.Helpers.ReCaptcha.Validate();
The complexity comes with the SSL implementation we are using.
I have added the appropriate settings to my web.config:
<system.net>
<defaultProxy>
<proxy proxyaddress="http://***proxy script settings**"
autoDetect="False"
usesystemdefault="False"
bypassonlocal="True" />
</defaultProxy>
</system.net>
There seems like there is nothing further I can do in terms of config, but I am getting the error message
The remote server returned an error: (404) Not Found
when I hit the recaptcha validate method on the form post method in my controller.
Ive found a number of other answers on here but they all seem to suggest that you change the url, or upgrade. As Im using a NuGet package I would have thought I was using the latest version. Any ideas or links with more information greatly appreciated. Ive already done quite a bit of looking both on this site and google
edit:
I have found that earlier versions of firefox have trouble actually rendering the recapture box given our network conditions, but the latest one is fine. As the validation is done on the controller though, I suppose there is no issue here.
After much pulling of hair and general confusion, I discovered that the problem was that the POST (but not the GET) to the google API was being blocked by our corporate firewall. I had previously discounted this, because I could navigate to the service that recaptcha uses (http://www.google.com/recaptcha/api/verify).
I found this by constructing an HTML page of the requisite parts for the post and submitting it in a browser. The corporate "This page is blocked" appeared - however in code the error that is returned is a 404. The error is somewhat misleading, but this is bizarre behavior from our infrastructure department.

Asp.Net-MVC application dying

I have a strange issue with an Asp.NET MVC application.
Using Asp.NET MVC 3 Preview 1 on IIS 7.5 - Integrated
After building the application everything runs fine. Then after some random amount of time (or sometimes after updating a view or js file) the application dies.
Meaning, requesting the root page, I get the 403 error and requesting any other page I get a 404 error.
After a rebuild everything works fine again for a little while until it dies again.
I am seeing this on two different development machines. Also, I have another application which is very similar (MVC 3, IIS etc) on both dev machines and this one runs without problem. I have inspected the config files in detail and cannot see anything of notable difference.
Does anyone know what could cause an application to die or where to look for further information? (I can still access elmah.axd though no information is there).
There's not much to go on here, but the 403 and 404 are clues that at least ASP.NET routing is not working; 403 is coming back because the web server thinks you want to do a directory browse, 404 because your request doesn't have a valid corresponding resource.
Since you are using the new version of MVC, I would suspect the issue may lye there. When you get the error condition, can you browse to a regular .aspx page? Does it execute server side code correctly?
You have the site hosted in IIS 7.5, not just the built in Visual Studio web server, right? Is it possible to turn on monitoring/event logging to see if IIS is taking a hit?
I apologize for not having any actual answer, sounds like you have a tough issue to debug.
Good Luck!

I am not able to run Asp.Net MVC 2 Application

I am trying an sample application in Asp.Net MVC 2 Application
given in http://www.codeproject.com/KB/aspnet/aspnet_mvc_tutorial.aspx
But i am getting the error as below
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/PersonalInformation/Index.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Please let mw know wat is the problem
The problem is the requested url. In an ASP.NET MVC application, the url corresponds to a controller action instead of the aspx page. See this link for an explanation: http://www.asp.net/LEARN/mvc/tutorial-02-cs.aspx.
The url should be something like http://localhost:xxxx/PersonalInformation (where xxxx is your port number)
To avoid getting this error everytime you start up your website through Visual Studio. Go to the properties of your web project and under the Web tab there is a property called Start URL. Change this to http://localhost:xxxx/ or something that is a valid MVC route.
Are you deploying to Cassini or IIS 6. Take a look at these articles
http://guyellisrocks.com/coding/deployed-asp-net-mvc-app-gives-404-on-about-page/
http://www.techdreams.org/microsoft/aspnet/how-to-fix-404-errors-of-aspnet-mvc-website-deployed-on-iis-6-windows-server-2003/2572-20090515
MVC runs fine in Cassini but requires some config modifications to run in IIS. I am still evaluating it in Cassini so i havent crossed that bridge yet but this info should help.

Resources