0

I have a MVC application, I try to run the application but I can not get any page in Browser, I am guessing the path has some problem.

This is RouteConfig:

      public class RouteConfig {
    public static void RegisterRoutes(RouteCollection routes) {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("{resource}.ashx/{*pathInfo}");

        routes.MapRoute(
            name: "Default", // Route name
            url: "{controller}/{action}/{id}", // URL with parameters
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
    }
}

This is HomeController:

   public ActionResult Index()
    {
        ViewBag.Message = "Welcome to DevExpress Extensions for ASP.NET MVC!";

        return View();
    }

This is the View's path:

Views -> Home -> Index.cshml

 @Html.DevExpress().ReportDesigner(settings =>
  {
    settings.Name = "ReportDesigner";
   }).Bind(new DevExpressDemo.Reports.Report1()).GetHtml()



  This URL is in Project URL: http://localhost:53975/ 

When I run the project I go to this URL:

    https://localhost:53975/Home/Index

But this is the response I am getting in Browser:

 This site can’t provide a secure connectionlocalhost sent an invalid response.

When I go to http://localhost:53975/ it convert it automatically to https and shows : This site can’t provide a secure connection

Alma
  • 3,780
  • 11
  • 42
  • 78
  • Have you tried to change the project URL? Right click your project name in the Solution Explorer, Select Properties, click the Web tab and change the https to http in the project url – Eric May 11 '21 at 15:40
  • Is this running in Visual Studio or IIS? – mxmissile May 11 '21 at 15:43
  • @mxmissile using build in IIS is visual Studio. – Alma May 11 '21 at 16:25
  • @Eric - In project property is http but when I run it is https, and even if I change the URL in browser, it will back to https. – Alma May 11 '21 at 16:26
  • which visual studio version 2019? – Eric May 11 '21 at 16:29
  • @Eric - Yes 2019 – Alma May 11 '21 at 16:32
  • https://stackoverflow.com/questions/60558382/err-ssl-protocol-error-for-localhost-from-visual-studio-debug check this link out you might have something in your web.config file that is setting this – Eric May 11 '21 at 16:42
  • 1
    Also you can click on your project in the solution explorer and click F4, make sure that SSL Enabled is false when the Properties window shows up. If this doesn't work either I would have to say it has to be something in the web.config file – Eric May 11 '21 at 16:50
  • 1
    If none of that works it could possibly be the User report designer for Devexpress when you bind their DevExpressDemo.Reports.Report1() – Eric May 11 '21 at 16:56
  • 1
    @Eric - maybe that id DevExpress thing! I made SSL enable and Use SSL URL and it worked! – Alma May 11 '21 at 16:57

2 Answers2

-1

You are trying to access it through https rather than http. Go to http://localhost:53975 in your browser and see if that works.

Will Walsh
  • 1,799
  • 1
  • 6
  • 15
  • even if I type http it automatically goes to https and shows This site can’t provide a secure connection. – Alma May 11 '21 at 15:34
-1

change HTTPS to HTTP on yourr brrowser address bar