passing text from one frame/page to another

T

Timmins

I have a date in a frame/page that i want to pass to another page. I can succefully pass a static value, i just can't pass a value from a text box.

I tried to make everything public. I believe that Me. may only refer to the page that is orginating the action. But how do I pass the text box. Can we assume since I can pass the static value, that the issue is how I grab the textbox value

the Error i get is
Object reference not set to an instance of an object

Here's the Property that is giving me trouble:

Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
Public DatePublicVar As String

Public ReadOnly Property FromDateTxt() As String
Get
'DatePublicVar = "12/12/2004" ' This Works
DatePublicVar = Me.FromDate.Text 'this doesn't
Return DatePublicVar
End Get

End Property

Thanks, I'm an old vb guy who still hasn't found out how to do some obvious tasks
 
S

Slim

Timmins said:
I have a date in a frame/page that i want to pass to another page. I can
succefully pass a static value, i just can't pass a value from a text box.
I tried to make everything public. I believe that Me. may only refer to
the page that is orginating the action. But how do I pass the text box. Can
we assume since I can pass the static value, that the issue is how I grab
the textbox value
the Error i get is
Object reference not set to an instance of an object

Here's the Property that is giving me trouble:

Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
Public DatePublicVar As String

Public ReadOnly Property FromDateTxt() As String
Get
'DatePublicVar = "12/12/2004" ' This Works
DatePublicVar = Me.FromDate.Text 'this doesn't
Return DatePublicVar
End Get

End Property


unless your form is called "me" no this wont work

if your text box in in a form
form1.texbox1.value

if not its
texbox1.value




Thanks, I'm an old vb guy who still hasn't found out how to do some
obvious tasks
 
B

Bob Lehmann

Your control, FromDate, is probably out of scope.

You should ask this question a DotNet group.

Bob Lehmann

Timmins said:
I have a date in a frame/page that i want to pass to another page. I can
succefully pass a static value, i just can't pass a value from a text box.
I tried to make everything public. I believe that Me. may only refer to
the page that is orginating the action. But how do I pass the text box. Can
we assume since I can pass the static value, that the issue is how I grab
the textbox value
the Error i get is
Object reference not set to an instance of an object

Here's the Property that is giving me trouble:

Protected WithEvents MsgLbl As System.Web.UI.WebControls.Label
Public WithEvents ToDate As System.Web.UI.WebControls.TextBox
Public WithEvents FromDate As System.Web.UI.WebControls.TextBox
Public DatePublicVar As String

Public ReadOnly Property FromDateTxt() As String
Get
'DatePublicVar = "12/12/2004" ' This Works
DatePublicVar = Me.FromDate.Text 'this doesn't
Return DatePublicVar
End Get

End Property

Thanks, I'm an old vb guy who still hasn't found out how to do some
obvious tasks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top