G
goalizx Goalizx
Hi!
I have two user controls. One of them was loaded
dynamically("quest.ascx"), and the other one declarative("menu.ascx").
Both are in the same Page.
So, how could I access to the values of "menu.ascx" control, from
"quest.ascx"?.
In the "menu.ascx" I have the GET PROPERTY as:
Protected withevents state As HtmlInputHidden
Public Property strState() As String
Get
Return CStr(state.Value)
End Get
End Property
I have tried to access it from "quest.ascx" as following:
Protected withevents menu As App.menu
'Protected withevents menu As New App.menu
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write(menu.strState)
End Sub
This is the error displayed:
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.
I understand the error, how could I write the correct instance of the
object?
Is there anybody could help me??
thx a lot
I have two user controls. One of them was loaded
dynamically("quest.ascx"), and the other one declarative("menu.ascx").
Both are in the same Page.
So, how could I access to the values of "menu.ascx" control, from
"quest.ascx"?.
In the "menu.ascx" I have the GET PROPERTY as:
Protected withevents state As HtmlInputHidden
Public Property strState() As String
Get
Return CStr(state.Value)
End Get
End Property
I have tried to access it from "quest.ascx" as following:
Protected withevents menu As App.menu
'Protected withevents menu As New App.menu
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write(menu.strState)
End Sub
This is the error displayed:
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.
I understand the error, how could I write the correct instance of the
object?
Is there anybody could help me??
thx a lot