Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Hiding labels and textboxs in formview templates according to role

Reply
Thread Tools

Hiding labels and textboxs in formview templates according to role

 
 
=?Utf-8?B?QW5u?=
Guest
Posts: n/a
 
      05-11-2007
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.vis ible = False
End If
End Sub

Thank you for your time.

Ann
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hiding labels and textboxs in formview templates according to role Ann ASP .Net Security 7 05-15-2007 05:13 AM
Accesing textboxs inside a table. Slim ASP .Net 6 07-31-2006 09:44 AM
how to Specializations of function Templates or Overloading Function templates with Templates ? recover C++ 2 07-25-2006 02:55 AM
Templates templates templates JKop C++ 3 07-21-2004 11:44 AM
How to select text in textboxs by clicking on it? Lily ASP .Net 1 12-23-2003 09:08 PM



Advertisments