locked
How do I get the current view or controller to run when I click the start in IIS (play button) in VS? RRS feed

  • Question

  • User562699594 posted

    I want my app to run the razor view I'm currently working on when I run the app instead of it defaulting to the home/index page.

    Friday, April 24, 2020 6:06 PM

All replies

  • User1535942433 posted

    Hi id3ma,

    Accroding to your description,as far as I think,there are two ways:

    1.set default page in iis:

    Administrative Tools-> IIS Manager -> You Server Name -> Your site name -> Under HTTP features -> Default document -> Add MyDefaultPage.aspx -->Enable

    2.write follow in web.config:

    <defaultDocument>
                <files>
                    <clear />
                    <add value="Logon/LogonScreen.aspx" />
                </files>
            </defaultDocument>

    More details,you could refer to below article:

    https://forums.asp.net/t/1882785.aspx?IIS+not+dispalaying+default+page

    Best regards,

    Yijing Sun

    Sunday, April 26, 2020 7:13 AM
  • User562699594 posted

    Thanks this is for IIS.  I'm looking for an answer on how to test the current View in VS 2019.

    Wednesday, April 29, 2020 3:35 PM
  • User1535942433 posted

    Hi id3ma,

    Accroding to your description,as far as I think,you could right click your project and set as startup project and then  you could select the properties-->web-->current page

    If you have setted a view as start page,you could cancel.You need to select the properties -->web -->clear the specific page items and select current page.

    Best regards,

    Yijing Sun

    Thursday, April 30, 2020 3:52 AM