The requested page cannot be accessed because the related configuration data for the page is invalid in MVC

The requested page cannot be accessed

The error message “The requested page cannot be accessed because the related configuration data for the page is invalid in MVC”  is occurred due to invalid code in the web.config file. Invalid code in the sense you may given a invalid tag like for <connectionString> you may given <constr>. it makes the error we should use the current xml tag names.

Please see the below examples

Actual tag code for connection string

<connectionString>

you may be made mistake like

<connectionstring>

See the above example the ‘S’ letter for the two example is different because the web.config file xml tags are case sensitive. it should follow the visual studio rules to avoid errors.

In web.config xml file we should specify the tags currently according to the visual studio needs.

if anything wrong in the web.config file you will get the error like

The requested page cannot be accessed because the related configuration data for the page is invalid in MVC

 

Leave a Reply