[Solved] Is HTML.Partial case sensitive? [closed]


No Html.partial() is not case sensitive. I tested it.

For example :

Let say Your partial view name is “_HeaDing.cshtml” and its place in the same folder.

Then you call the partial view in different cases like below:

1.  @Html.Partial("_heading")-All characters are in smaller case
2.  @Html.Partial("_HEADING")- All characters are in Upper case

In all combination cases, it will work correctly by calling the same file.

Additional Info:

For calling the views in different folder or in different path ,kindly follow the below syntax:

// Uses a view in current folder with this name
// If none is found, searches the Shared folder
@Html.Partial("ViewName")

// A view with this name must be in the same folder
@Html.Partial("ViewName.cshtml")

// Locate the view based on the application root
// Paths that start with "https://stackoverflow.com/" or "~/" refer to the application root
@Html.Partial("~/Views/Folder/ViewName.cshtml")
@Html.Partial("/Views/Folder/ViewName.cshtml")

// Locate the view using relative paths
@Html.Partial("../Account/LoginPartial.cshtml")

Source: https://learn.microsoft.com/en-us/aspnet/core/mvc/views/partial

Hope this will helpful for you,Kindly let me know your thoughts or feedbacks

Thanks

Karthik

solved Is HTML.Partial case sensitive? [closed]