visual studio – “Add” button disabed when creating a view


I want to generate a view or partial view from actionby clicking “Add
View” button. But as you can see the button is disabled and I cannot
generete anything.

Actually, your Add button is disabled because you have either removed model class /templete value or haven’t selected anything which causing the issue.

Most importantly, While selecting view you should take either you should select context model or if there is not relevant model class it should select to Empty or without model from the dropdown, other than, your Add button would be disabled.

I have reproduced your issue accordingly as you can see down below:

enter image description here

How to resolve:

You can follow below steps to include your view:

enter image description here

Output:

enter image description here

Note: Please refer to this official document if you would like to know more details.

Leave a Reply

Your email address will not be published. Required fields are marked *