Help with VB.Net setting getting properties

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
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top