Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 21: public partial class ContactUs : System.Web.UI.Page
Line 22: {
Line 23: 	 private SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["newsletteremail"].ConnectionString);
Line 24:     protected void Page_Load(object sender, EventArgs e)
Line 25:     {

Source File: e:\inetpub\vhosts\moteldirectory.org\httpdocs\contact-us.aspx.cs    Line: 23

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
   ContactUs..ctor() in e:\inetpub\vhosts\moteldirectory.org\httpdocs\contact-us.aspx.cs:23
   ASP.contact_us_aspx..ctor() in e:\inetpub\vhosts\moteldirectory.org\tmp\root\0114762b\7ca59f66\App_Web_32ro45sc.0.cs:0
   __ASP.FastObjectFactory_app_web_32ro45sc.Create_ASP_contact_us_aspx() in e:\inetpub\vhosts\moteldirectory.org\tmp\root\0114762b\7ca59f66\App_Web_32ro45sc.6.cs:0
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +141
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +45
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +417
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +74
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +157


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0