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!