Click here to Skip to main content
15,887,822 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: calculate the weighted average Pin
Kenneth Haugland28-Jul-15 1:19
mvaKenneth Haugland28-Jul-15 1:19 
AnswerRe: calculate the weighted average Pin
deepankarbhatnagar28-Jul-15 2:14
professionaldeepankarbhatnagar28-Jul-15 2:14 
GeneralRe: calculate the weighted average Pin
jkirkerx28-Jul-15 6:25
professionaljkirkerx28-Jul-15 6:25 
QuestionDisplay data from SQL database to HTML page in table format using Angular JS Pin
iamcpmember27-Jul-15 0:21
professionaliamcpmember27-Jul-15 0:21 
QuestionApplied css styles showing wrong in mozilla firefox Pin
Member 920164824-Jul-15 2:50
Member 920164824-Jul-15 2:50 
AnswerRe: Applied css styles showing wrong in mozilla firefox Pin
jkirkerx24-Jul-15 9:29
professionaljkirkerx24-Jul-15 9:29 
GeneralRe: Applied css styles showing wrong in mozilla firefox Pin
Member 92016485-Aug-15 21:25
Member 92016485-Aug-15 21:25 
Questionhiding label and textbox after update Pin
spirospap22-Jul-15 19:16
spirospap22-Jul-15 19:16 
Hi all,

I have a question regarding hiding of a label and a textbox on a page based on AD group membership (I only want members of the AD group to view and use the ASP control)

So I have the following within my Page_Load Sub
Dim ITContactLabel As Label = DirectCast(FormView1.FindControl("ITContactLabel"), Label)
Dim ITContactTextBox As TextBox = DirectCast(FormView1.FindControl("PRJ_ITContactTextBox"), TextBox)

If (User.IsInRole("MyDomain\My_AD_Group_X") <> "true") Then
    '   hide the ITContact label
    ITContactLabel.Style("visibility") = "hidden"
    ITContactTextBox.Visible = "false"
End If

And it works fine when the page is first loaded, but after I hit the update link, the label and textbox become visible.

I have tried to define an OnClick event in my code, but not having success hiding the label and textbox:

Protected Sub UpdateButton_Click(sender As Object, e As System.EventArgs)

in html:
<asp:linkbutton id="UpdateButton" runat="server" causesvalidation="True" onclick="UpdateButton_Click" commandname="Update" text="Update">

I'm thinking it may have something to do with checking the AD group membership, but not sure, any help would be appreciated.
AnswerRe: hiding label and textbox after update Pin
Blikkies23-Jul-15 0:46
professionalBlikkies23-Jul-15 0:46 
GeneralRe: hiding label and textbox after update Pin
spirospap23-Jul-15 12:11
spirospap23-Jul-15 12:11 
SuggestionRe: hiding label and textbox after update Pin
ZurdoDev23-Jul-15 3:26
professionalZurdoDev23-Jul-15 3:26 
QuestionTrying to prevent the first dropdownlist value changing my database field unless I need to in C# Pin
Norris Chappell22-Jul-15 16:30
Norris Chappell22-Jul-15 16:30 
AnswerRe: Trying to prevent the first dropdownlist value changing my database field unless I need to in C# Pin
Herman<T>.Instance23-Jul-15 11:06
Herman<T>.Instance23-Jul-15 11:06 
GeneralRe: Trying to prevent the first dropdownlist value changing my database field unless I need to in C# Pin
Norris Chappell23-Jul-15 18:23
Norris Chappell23-Jul-15 18:23 
GeneralRe: Trying to prevent the first dropdownlist value changing my database field unless I need to in C# Pin
Herman<T>.Instance23-Jul-15 20:51
Herman<T>.Instance23-Jul-15 20:51 
Questionquery Pin
saif.rashid21-Jul-15 22:35
saif.rashid21-Jul-15 22:35 
AnswerRe: query Pin
Blikkies21-Jul-15 23:13
professionalBlikkies21-Jul-15 23:13 
AnswerRe: query Pin
F-ES Sitecore22-Jul-15 0:40
professionalF-ES Sitecore22-Jul-15 0:40 
AnswerRe: query Pin
Richard Deeming22-Jul-15 1:42
mveRichard Deeming22-Jul-15 1:42 
GeneralRe: query Pin
Herman<T>.Instance22-Jul-15 22:42
Herman<T>.Instance22-Jul-15 22:42 
QuestionDevExpress ASpx Gridview Row Selection on keyboard Arrow key Pin
hemant kolekar20-Jul-15 19:33
hemant kolekar20-Jul-15 19:33 
AnswerRe: DevExpress ASpx Gridview Row Selection on keyboard Arrow key Pin
Wendelius20-Jul-15 19:43
mentorWendelius20-Jul-15 19:43 
QuestionCSRF question Pin
Stephen Holdorf20-Jul-15 10:31
Stephen Holdorf20-Jul-15 10:31 
AnswerRe: CSRF question Pin
Anil Vaghasiya20-Jul-15 19:37
professionalAnil Vaghasiya20-Jul-15 19:37 
AnswerRe: CSRF question Pin
Richard Deeming21-Jul-15 1:37
mveRichard Deeming21-Jul-15 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.