N
~~~ .NET Ed ~~~
I have a web form that displays some information and then at the bottom it
has a Button control. This control has both a Click and Command event
handlers.
I was getting the following exception when the button was pressed:
[NullReferenceException: Object reference not set to an instance of an
object.]
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +28
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292At that time only the Click
handler had something and it was very simple: if
(this.ButtonContinue.CommandName != null) { ... }I eliminated all the code
from both the Click and Command event handlers,
has a Button control. This control has both a Click and Command event
handlers.
I was getting the following exception when the button was pressed:
[NullReferenceException: Object reference not set to an instance of an
object.]
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +28
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1292At that time only the Click
handler had something and it was very simple: if
(this.ButtonContinue.CommandName != null) { ... }I eliminated all the code
from both the Click and Command event handlers,