Re: [ASP.Net2] Object reference not set to an instance of an object.
- From: "Kevin Spencer" <kevin@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 10 Nov 2005 07:25:37 -0500
My first question would be, is there a textbox in the page? My second
question would be, is it named "txtBox"?
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
Complex things are made up of
Lots of simple things.
"WONG Chi Kit Keith" <civkit@xxxxxxxxxxx> wrote in message
news:%23kgZS0d5FHA.2888@xxxxxxxxxxxxxxxxxxxxxxx
When the following script is processed, errors return:
Partial Class _Default
Inherits System.Web.UI.Page
Public Sub New()
Me.txtBox.Text = "This is a text box."
End Sub
End Class
Error:
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 5:
Line 6: Public Sub New()
Line 7: Me.txtBox.Text = "This is a text box."
Line 8: End Sub
Line 9: End Class
Source File: f:\inetpub\wwwroot\Default.aspx.vb Line: 7
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
_Default..ctor() in c:\inetpub\wwwroot\Default.aspx.vb:7
ASP.default_aspx..ctor() in c:\inetpub\wwwroot\Default.aspx.vb:912304
__ASP.FastObjectFactory_app_web_rzbiactk.Create_ASP_default_aspx() +38
System.Web.Compilation.BuildResultCompiledType.CreateInstance() +49
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath
virtualPath, Type requiredBaseType, HttpContext context, Boolean
allowCrossApp, Boolean noAssert) +115
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context,
String requestType, VirtualPath virtualPath, String physicalPath) +31
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext
context, String requestType, VirtualPath virtualPath, String physicalPath)
+40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String
requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
+139
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
+120
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +155
.
- Prev by Date: define contact mailbox
- Next by Date: Re: Nested web user Control
- Previous by thread: define contact mailbox
- Next by thread: Re: Nested web user Control
- Index(es):
Relevant Pages
|