Gertie Posted May 28, 2003 Posted May 28, 2003 Hello, I have a usercontrol. In it is a string declared. Now for me a simple question, but not easy to find an answer on the net: Can i get the value of this string to a new string in the form that has the ascx file implemented on it? thanks a lot, Gertie Quote
Gertie Posted May 28, 2003 Author Posted May 28, 2003 ok, so far so far all i came up with is making a function in the user control named GiveUser that returns the string. Then i made following changes in my form. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim hoofding As Control = Page.FindControl("Hoofding") Dim hoofdingType As Type = hoofding.GetType Dim hoofdingGetUser As PropertyInfo = hoofdingType.GetProperty("GiveUser") strUser = hoofdingGetUser.GetValue(hoofding, Nothing).ToString() If strUser = "" Then pnlLogIn.Visible = False pnlLogOut.Visible = True Else pnlLogIn.Visible = True pnlLogOut.Visible = False End If End Sub thanks, guys for any help on this Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.