relative path to ASP.NET Core Razor page hyperlink RRS feed

  • Question

  • I am a novice with ASP.NET Core Razor pages.

    What is the correct syntax for including a hyperlink to another Razor page found within the same folder? 

    I can't seem to find the right path.
    Friday, September 11, 2020 4:50 PM

All replies

  • You can manually do it, because the razor helper tags are suspect. 

    it's equates to Pages/Article/ArticleIndex 
    @model IndexModel
        ViewData["Title"] = "Index";
    <!DOCTYPE html>
        <meta name="viewport" content="width=device-width" />
        <br /><br />
        <h5>Authors select Articles</h5>
        <br />
        <table border="1" cellpadding="10">
                <th>First Name</th>
                <th>Last Name</th>
                <th colspan="4">Actions</th>
            @foreach (var item in Model.AuthorVM.Authors)
                        <a href="/Article/ArticleIndex?id=@item.AuthorID">Select</a>


    ASP.NET has forums.

    Friday, September 11, 2020 6:21 PM