Click here to Skip to main content
14,828,868 members
Please Sign up or sign in to vote.
2.15/5 (5 votes)
See more:
Hi All,
Before selecting any page it is by default showing the home page. when i select one partiicular page it is showing this error. it is developed by mvc3 (Razor). Can any body help me in Razor which page runnig first or how can i go back?



\Server Error in '/' Application.
--------------------------------------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /Views/home/Index.cshtml


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Posted
Updated 13-Aug-20 20:50pm
Comments
[no name] 9-Jul-12 14:07pm
   
Well... gee... offhand I would say that your application or IIS cannot find Views/home/Index.cshtml. Is IIS configure correctly? Does that page exist in that location?
khosnur 9-Jul-12 14:10pm
   
thanks for reply. Yes sir the page is there but why it doesn't find it i don't know.I am using IIS 7.5. what type of configure is needed? can u tell me clearly plz... thanks in advance

One reason this could occur is if you don't have a start page set under your web project's properties. So do this:


  • Right click on your mvc project
  • Choose "Properties"
  • Select the "Web" tab
  • Select "Specific Page"
  • Assuming you have a controller called HomeController and an action method called Index, enter "home/index" in to the text box corresponding to the "Specific Page" radio button.


Now, if you launch your web application, it will take you to the view rendered by the HomeController's Index action method.

(or)

Simply, you could also open one of the controllers in your project and then hit on F5 or Ctrl + F5.

What's happening now is that, you are currently in your /Views/home/Index.cshtml view and you just hit on F5 or Ctrl + F5. In an mvc project, you cannot open a file w/ .cshtml extension directly as IIS cannot understand that. The controller is supposed to return a matching view from within the action method.

As a side-note also check if you have MVC 3 installed correctly. If my answer doesn't help, I am sorry.

Hope this helps!
   
Comments
khosnur 9-Jul-12 15:18pm
   
thank you very much sir it's working now. deep love from my heart. what can i do for u. one thing i did that i voted u. i have another question plz reply that.
Pratik Bhuva 18-Sep-13 5:43am
   
Thank You So much...
khosnur 9-Jul-12 15:27pm
   
Karthik Sir, I have one site developped by MVC3 running by IIS 7.5 on win 2008 r2 Server Back End Oracle.When i run the application first page coming no problem but when i giving user name and password its showing this error:

HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred.

But the Application running smoothly on 2003 server. How can I solve this big problem plz help me. Thanks in Advance...
Karthik. A 9-Jul-12 15:39pm
   
You are welcome! An internal server error could occur for numerous reasons like - incorrect database server, incorrect username / password etc etc. The best way to approach this would be to find out what's the actual error. You have said that you could see the 1st page, but the error happens after you enter the user name/ password. What type of authentication does your web application / site use ? See if it's setup correctly in IIS under the "Authentication" module. Also, go to the server and visit your page there, instead of from a machine that just acts as a client. If you use the server itself, it will give you much more information than a useless "500 internal server" error. If you could do that and see the actual error, it might be helpful If you have qns. post it here and one of us will help! Its difficult to help w/ just the general 500 error...
Sharyu Dhable 16-Dec-16 2:15am
   
Thanks , its working
khosnur 9-Jul-12 16:00pm
   
Thank you again to reply.I will give you brief error message.But Sir i really fallen in great problem about that matter. this is the first actually i am doing this thing. i am migrating 2003 to 2008. I can not run the application on 2008.can plz sir get ur email address? if i miss then i will mail you.....plz sir
derloopkat 14-Feb-13 7:18am
   
sorry but it doesn't solve the issue at all, i know the page exists and don't need to set up my project to use it as start page, anyway i sorted it out by mapping the route in global.asax
Shankrayya R 12-Mar-13 1:43am
   
Hi Karthik,

I have same problem /application error and it will work fine in local while debugging the application but I will get error when I deploy it in the 2003 server for users who are going to access. After clearing IE temporary files it will work fine as it is temporary solution. Please let me know permanent solution. Even I have tried setting start page and startup project in asp.net 2.0

Technologies used
Visual studio 2005m asp.net 2.0 and sql server 2000.

Please let me know the solution.

Thanks in advance.
amolko 5-Jul-13 3:43am
   
While debugging my 1st page working but when i was click for registration gives following error


Registration
Click here to Registration

here code is
Registration

@Html.ActionLink("Click here to Registration", "Registration", "RegistrationView")

Please help !!!!!


Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /RegistrationView/Registration
CHill60 5-Jul-13 8:48am
   
Because you are responding to an old question which is already answered, very few people will read your post. You are better off posting your own question using the "Ask a question" link at the top of the page - it will then appear in the list of unaswered questions and more people will see it. You can always provide a link to this question in your own explaining how it didn't solve your problem
Sanjoy Kumar Das 4-Feb-15 6:34am
   
Thanks Boss.
Its Works form me
[no name] 4-Sep-15 13:33pm
   
I like your answer, have a 5.
shinaxin 14-Jan-16 13:58pm
   
thanks very much, it's works for me
Member 12459765 16-Apr-16 3:59am
   
not worked for me
Abdulmajid Musa 10-Aug-16 8:21am
   
Thanks A lot man
Member 14564587 28-Nov-19 4:03am
   
I have also this error. But I can't solve that.
simple solution

C#
Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 


simple eg. in view i have a AHU folder and i make index.cshtml page this page run properly but i make this folder new page add.cshtml and now run i get Error (above).This type error solution is please check method/function in your controller page like
C#
public ActionResult add()//your view page
       {
           return View();
       }


I hope you get your answer
   
Comments
Richard Deeming 16-Aug-16 9:17am
   
This question was asked, answered, and solved over FOUR YEARS AGO.
Huzaifa Abbas 2-Mar-18 6:30am
   
Hello Sir,

I have a same problem, my project runs good on the localhost but after publish on online server it returns this error.

Please help, Thanks in advance

Sorry for my english
[no name] 1-Oct-18 11:39am
   
Where please
Richard Deeming 1-Oct-18 13:53pm
   
Solution 1[^], which was accepted by the OP in July 2012.
If this type of error in your project then we need to create a webform that webform name have must same on u showing the browser URL name
thank you
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900