P
Paul
Hello, and Good Morning,
I need to Cross-page post some values to the target page. Since I am using
Master pages and User Controls, I am finding it hard to get the thing
working, so I am trying to use Properties to do so. So, in a test page, I
have a ViewForm with labels in it, and a few asp.net controls that are
outside of the ViewForm. If I code:
'TestCode for posting to next page using Properties
Public ReadOnly Property StoreName() As String
Get
Return TextBox1.Text
End Get
End Property
The receiving page dispalys the info correctly. But, how do I get the value
of a label (or any other object) that is inside a control? (And later, it
will be in a UserControl too).
I tried
Public ReadOnly Property StoreName()
Get
Dim pp_StoreName As Label
pp_StoreName = CType(FormView1.FindControl("StoreNameLabel"),
Label)
Return pp_StoreName
'FormView1.FindControl("StoreNameLabel").ToString
End Get
End Property
Where there is a FormView that is on the page, and a label with ID
StoreNameLabel within that control. But it does not work.
How do I reference the label StoreNameLabel that is in the ViewForm1?
(And if that ViewForm is in a UserControl called WoofUserControl.ascx?)
TIA
I need to Cross-page post some values to the target page. Since I am using
Master pages and User Controls, I am finding it hard to get the thing
working, so I am trying to use Properties to do so. So, in a test page, I
have a ViewForm with labels in it, and a few asp.net controls that are
outside of the ViewForm. If I code:
'TestCode for posting to next page using Properties
Public ReadOnly Property StoreName() As String
Get
Return TextBox1.Text
End Get
End Property
The receiving page dispalys the info correctly. But, how do I get the value
of a label (or any other object) that is inside a control? (And later, it
will be in a UserControl too).
I tried
Public ReadOnly Property StoreName()
Get
Dim pp_StoreName As Label
pp_StoreName = CType(FormView1.FindControl("StoreNameLabel"),
Label)
Return pp_StoreName
'FormView1.FindControl("StoreNameLabel").ToString
End Get
End Property
Where there is a FormView that is on the page, and a label with ID
StoreNameLabel within that control. But it does not work.
How do I reference the label StoreNameLabel that is in the ViewForm1?
(And if that ViewForm is in a UserControl called WoofUserControl.ascx?)
TIA