Hiding labels and textboxs in formview templates according to role

G

Guest

I have a formview with templates. I want to hide certain labels or textboxes
according to the user's role membership. I can do this in a sub routine as
long as it's not inside a template, is it possible to do this inside a
formview template?

Some code sample that does not work:

Protected Sub passPhrase_Init(ByVal sender As Object, ByVal e As
System.EventArgs)
If (Roles.IsUserInRole("networkServices")) Then
FormView1.UniqueID.passphrase.visible = True

Else
FormView1.ItemTemplate.itemtemplate.passphrase.visible = False
End If
End Sub

Thank you for your time.

Ann
 

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,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top