Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Unable to find Resource

My URL is https://localhost:44307/Teachers/Index1

And, I have Index1 Action method in my Teachers controller
and I Have View "Index1" in my Teachers folder.

But, It's not working.
All other links are working fine

What I have tried:

I tired to check for any errors in my code but there are no errors
Posted
Updated 5-Feb-22 22:33pm

Quote:
"I tired to check for any errors in my code but there are no errors"

If the resource was there and the code had no errors, you wouldn't have a problem!

But we have no idea what you code is doing, or how it is doing it - and that's probably very relevant to the problem ... and we can;t see your code, or examine your system to see what resources it is using. A 404 error normally means that a page you requested does not exist, and since we can't even access the main site, much less look at the server code we can't help you.

So, it's going to be up to you.
Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. If you don't know how to use it then a quick Google for "Visual Studio debugger" should give you the info you need.

Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.

Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!
 
Share this answer
 
You should also carefully review your Route Values in Global.ascx file
routes.MapRoute(
   "Default", // Route name
   "{controller}/{action}/{id}", // URL with parameters
   new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
You also need to verify that you have added ‘Controller’ suffix with your controller name. In you case TeachersController.
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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