This page is in the following directory
D:\InetPub\vhosts\crystalcomputerconcepts.com\httpdocs\aspworks

The file name is: /ReturnIndexCS.cshtml

Choice between file ending in htm or html.

This file has a different extension

The razor code that found the directory is:
@{ string strDir = Server.MapPath(".");}

The directory is obained wih the razor code @strDir

The razor code that determned the file extension.

@if (strDir.EndsWith(".html", StringComparison.OrdinalIgnoreCase))
{
     <p>his file ends with .html</p>
}
else if (strDir.EndsWith(".htm", StringComparison.OrdinalIgnoreCase))
{
    <p>This file ends with .htm</p> 
}
else
{
     <p>This file has a different extension</p>
}

Noting the file directory of the page.

Here the code is developed to choice a direcrory
and based on that directory to render its return index.

Return to Table of Contents

This code notes the directory to select its return index page..

@if (strDir == (@"D:\InetPub\vhosts\crystalcomputerconcepts.com\httpdocs\ASPtestSite"))
{
<p>p>Return to <a href='index.html'>Table of Contents</a></p>
}
else
{
<p>p>Return to <a href='index.htm'>Table of Contents</a></p>
}