M
mike.gilmore
Hi,
I'm trying to move all my custom validation code into the master
page. Unfortunately anytime I use the response, request, or trace
objects in any master page module (other than page_load), " Object
reference not set to an instance of an object." is the error I
receive.
Below is a sample of code that will not work on my web server. Any
suggestions/advice are appreciated.
Thanks.
Debug.aspx.vb (btnGo - is a web control object in Default.aspx)
Partial Class Debug
Inherits System.Web.UI.Page
Protected Sub btnGo_Command(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs) Handles btnGo.Command
Dim objMaster As New DebugMaster
With objMaster
.CheckResponseObject()
End With
End Sub
End Class
DebugMaster.Master.Vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Response.Write("Inside the Master Page - Page_Load event
handler")
End Sub
Public Sub CheckResponseObject()
Response.Write("Inside the Master Page - CheckResponseObject
method")
End Sub
----------------------
On load the Master Page's page load "Response.Write" works, however
when the btnGo event is called (thus calling CheckResponseObject), the
page returns an " Object reference not set to an instance of an
object." exception.
Similar errors are called when I use the request or trace objects as
well.
Any advice on how to resolve would be greatly appreciated.
Thanks,
Mike
I'm trying to move all my custom validation code into the master
page. Unfortunately anytime I use the response, request, or trace
objects in any master page module (other than page_load), " Object
reference not set to an instance of an object." is the error I
receive.
Below is a sample of code that will not work on my web server. Any
suggestions/advice are appreciated.
Thanks.
Debug.aspx.vb (btnGo - is a web control object in Default.aspx)
Partial Class Debug
Inherits System.Web.UI.Page
Protected Sub btnGo_Command(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs) Handles btnGo.Command
Dim objMaster As New DebugMaster
With objMaster
.CheckResponseObject()
End With
End Sub
End Class
DebugMaster.Master.Vb
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Response.Write("Inside the Master Page - Page_Load event
handler")
End Sub
Public Sub CheckResponseObject()
Response.Write("Inside the Master Page - CheckResponseObject
method")
End Sub
----------------------
On load the Master Page's page load "Response.Write" works, however
when the btnGo event is called (thus calling CheckResponseObject), the
page returns an " Object reference not set to an instance of an
object." exception.
Similar errors are called when I use the request or trace objects as
well.
Any advice on how to resolve would be greatly appreciated.
Thanks,
Mike