locked
VS 2017 - ASP.NET Web Application - Suddenly the Local Host Web Server is Failing RRS feed

  • Question

  • User-229513795 posted

    Hello Community,

    I am working in VS 2017, I created an ASP.NET Web Application, and I am building a Modal Navigation solution using Bootstrap 4.1, JavaScript and HTML.  I'm use to compiling the application, watching the local host server load, and then working with my application by clicking on the Navbar and seeing the Modal Dialog Box open up.  The problem is this - Now, when the solution loads, I see the launch Navbar, but when I click the button, the modal opens, but the whole screen goes dark and I can't open anything.  Has anyone else seen this issue?  If so then please provide guidance and examples.

    Thanks!

    Tom

    Friday, December 7, 2018 3:44 PM

Answers

  • User61956409 posted

    Hi Tom,

    full code is on JS Fiddle: https://jsfiddle.net/tsmolskow/aq9Laaew/287783/

    I do a test with the code that you provided on my local IIS express, the code works as expected. 

    when I click the button, the modal opens, but the whole screen goes dark and I can't open anything. 

    To troubleshoot the issue, please use F12 developer tools to find/select the overlay element and check the actual CSS styles that are applying to the overlay element.

    Besides, if possible, you can try to add a new page and reference only required css&js files (without using master page) to test if the code can work as expected on that new page.

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 10, 2018 5:58 AM

All replies

  • User475983607 posted

    We can only guess without the source code.  I assume you forgot to dismiss the modal.

    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>

    Bootstrap docs.

    https://getbootstrap.com/docs/4.0/components/modal/

    Friday, December 7, 2018 3:54 PM
  • User-229513795 posted

    Sorry, full code is on JS Fiddle: https://jsfiddle.net/tsmolskow/aq9Laaew/287783/

    I have a close button:

    <div>
    <button class="close" aria-label="Close" type="button" data-dismiss="modal">
    <span aria-hidden="true">X
    </span>
    </button>

    this happens when the modal first opens.

    You can see a screen scrape here - https://social.msdn.microsoft.com/Forums/en-US/050f41ef-6cb4-4189-9bcd-58a9c0d543f9/vs-2017-aspnet-web-application-suddenly-the-local-host-web-server-is-failing?forum=visualstudiogeneral

    Friday, December 7, 2018 4:12 PM
  • User475983607 posted

    I'm unable to reproduce the same results in jsfiddle.  I recommend using the browser's dev tools to view the styles applied to the HTML.  

    Friday, December 7, 2018 4:30 PM
  • User-229513795 posted

    Yeah it's fine in JSFiddle, I believe the issue is related to IIS Express, which JSFiddle doesn't use.

    Friday, December 7, 2018 4:46 PM
  • User475983607 posted

    Tom Molskow

    Yeah it's fine in JSFiddle, I believe the issue is related to IIS Express, which JSFiddle doesn't use.

    But the code runs in the browser not IIS Express.  I would use Dev Tools to look at the styles applied to the elements.

    Edit: I built a test in Visual Studio hosted by IIS Express and was unable to reproduce the issue.

    Friday, December 7, 2018 5:05 PM
  • User1120430333 posted

    Have you done a Clean and Rebuild of the solution?

    Friday, December 7, 2018 7:28 PM
  • User-229513795 posted

    @mgebhard - which says it's not code, but it could be IIS Express if the port I've been using has become blocked by another application or closed by Global Policy

    Friday, December 7, 2018 9:52 PM
  • User-229513795 posted

    @DA924 - just tried that - same result

    Friday, December 7, 2018 9:52 PM
  • User475983607 posted

    @mgebhard - which says it's not code, but it could be IIS Express if the port I've been using has become blocked by another application or closed by Global Policy

    No, a blocked port would cause an IO error and the HTML would never reach the browser in the first place.

    If there's post backs or AJAX then it could be an issue with the HTML.  Please use dev tools to debug the source. 

    Saturday, December 8, 2018 12:12 AM
  • User61956409 posted

    Hi Tom,

    full code is on JS Fiddle: https://jsfiddle.net/tsmolskow/aq9Laaew/287783/

    I do a test with the code that you provided on my local IIS express, the code works as expected. 

    when I click the button, the modal opens, but the whole screen goes dark and I can't open anything. 

    To troubleshoot the issue, please use F12 developer tools to find/select the overlay element and check the actual CSS styles that are applying to the overlay element.

    Besides, if possible, you can try to add a new page and reference only required css&js files (without using master page) to test if the code can work as expected on that new page.

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 10, 2018 5:58 AM
  • User-229513795 posted

    @Fei Han - what if it's IIS Express itself that is the problem?  If my code runs on your system then isn't the problem my system not my code?  How can I check the health of IIS Express?

    Tuesday, December 11, 2018 12:41 PM
  • User475983607 posted

    Tom Molskow

    what if it's IIS Express itself that is the problem?  If my code runs on your system then isn't the problem my system not my code?  How can I check the health of IIS Express?

    CSS and JavaScript run in the browser not the host (IIS Express).  Use the browser's Dev Tools to debug the code.  Dev tools shows the styles applied to elements, allows you to debug JavaScript, and shows the HTTP request/response from IIS Express.

    All major browsers have dev tools.

    https://developers.google.com/web/tools/chrome-devtools/

    Tuesday, December 11, 2018 2:02 PM