How to turn off autotabbing on cshtml files

Daniel Robertson 0 Reputation points
2023-05-23T11:58:34.23+00:00
Visual Studio will automatically indent HTML on a cshtml file when C# is added below.

EG

@{
    <partial>...
    <div>....
        <button>...
}
Will auto-tab to the below if code is added and auto completes such as a simple open closing bracket as shown

@{
        <partial>...
        <div>....
            <button>...
} {}
Does anyone know how to turn off the autotabbing feature as nothing seems to be working.

Tried setting the All Languages > Tabs > Indenting to None, same for all other code bases. Tried turning off Text Editor > Advanced > Use adaptive formatting
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,860 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,266 Reputation points Microsoft Vendor
    2023-05-24T08:33:54.1966667+00:00

    Hello @Daniel Robertson,

    Welcome to Microsoft Q&A forum.

    I can reproduce this issue and I have reported this issue on our Developer Community for further check. Here’s the thread link: Can’t turn off autotabbing on cshtml files.

    Please kindly follow up that thread and add more details there in case I miss some parts. If there’s any update, I will inform you.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments