<%@ Application language="C#" CodeBehind="Global.asax.cs" Inherits="Global" %>I then went about defining a class called "Global" in Global.asax.cs. I added the code I needed and proceeded to build the ASP.NET app in Visual Studio 2005. But I got an error:Global.asax(1): Build (web): Could not load type 'Global'.Of course, I was perplexed. Why not? Why couldn't the type be loaded?I thought for a bit, but then went about doing some more coding. Eventually, I had to address the problem, though. How? On a whim I placed Global.asax.cs in the App_Code ASP.NET folder. Once I did that, I was able to build the app.
»
Very helpful. This is what happens when people with no common sense or basic sense of usability write programs.
ReplyDeleteHeh. Good one. Thanks for visiting, and for your constructive comment.
ReplyDeleteI had the same problem as you. And you helped me out! Cheers :-) Ignore the idiot who left the other comment
ReplyDeleteThanks for sharing. I have the same problem. It's weird that in the CodeBehind does not reference app_code\global.asax.cs
ReplyDeleteSo here I am, four full years later using Visual Studio 2010 and experiencing the same problem. That first a-hole comment was a little unbelievable. I would love to see him put down. So he thinks he knows it all? I'm fuming... BTW, your solution worked for me also. I had to move two different code-behind files to the App_Code folder. (I'm sure this would not have been a problem had I coded everything. But I had to use code that someone else wrote and I am so very appreciative of a solution.) Thanks again.
ReplyDeleteVery helpful. Exactly what I needed!
ReplyDelete