Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...