Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 05, 2006 12:27 AM by Rontch
Jan 08, 2004 06:11 AM|LINK
Jan 08, 2004 07:01 AM|LINK
Apr 05, 2006 12:27 AM|LINK
"Object not set to an instance.."
** it useally happens after you publish the web site..
The problem comes from the fact that the code files (C#) can not access one to another as you probably programmed them to do so..
The thing is that when publishing the web site, the compiler builds DLL files for EACH page and another seperate dll file for App_code.
If your Web application includes code that you want to share between pages - this code should be in the App_code directory!!
The principal that we have to put in mind is that:
'The content of application folders (except for the App_Themes folder) is NOT served in response to Web requests, but it CAN be ACCESSED from application code.'
You can store source code in the App_Code folder, and it will be automatically compiled at run time.
The resulting assembly is accessible to ANY other code in the Web application.
In order to change the software design to fit the new principal - do this:
1. cut all the code from the in-accessable page and switch it to -
public partial class Migrated_myClass : myClass
2. create the same myClass.cs file under the App_code directory, like that -
public partial class myClass
// all the code comes here...