.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

How to hide labels based on permissions

Posted By:      Posted Date: October 18, 2010    Points: 0   Category :SharePoint
In my .ascx.cs file i need to hide some labels based on the permission granted to the user loggin in the site. So i need a way to programmatically get the user type (member, owner, visitor, viewer) and then check the permission level. Or is there another way to do this?

View Complete Post

More Related Resource Links

how to hide/display controls in NewForm.aspx based on dropdown value in SharePoint list



I have 1 dropdown in my sharepoint list with other columns. If dropdown value equal to 'xyz' i need to display some other controls, otherwise these controls should be hidden.

I know we can achieve this with javascript. If any one can provide code or sample then it will be appreciated. or is there any other alternative methods to do this ........

Thanks & Regards, Neerubee

Claims Based Auth Corrupting Permissions?

So I'm noticing everytime I enable claims based authentication on a web application all pre-existing windows based permissions fail. I believe this is due to the Identity Manager presenting a different account than those present from Classic mode authentication. You can see below that the Classic Mode Account's list the normal domain\username while the claims based version of the same account is completely different and causing a mismatch. So I figure I must be missing something obvious for how to migrate to claims based, they can't honestly expect people to redo permissions across their entire sharepoint instance. Example (DisplayName followed by Account): Name: All Authenticated Users Account: c:0(.s|true Name: NT AUTHORITY\authenticated users Account: NT AUTHORITY\authenticated users Name: DOMAIN\domain users Account: c:0+.w|s-1-5-21-2428780107-2384587425-257213858-513 Name: DOMAIN\domain users Account: DOMAIN\domain users

Infopath 2007 Repeating Table hide row based on Text values of column

Infopath 2007 browser based form Full Trust Example: I have a repeating table (FruitChoice) that has multiple columns. Both drop down list point to sharepoint list data sources. Choose your tree ft. drop down list – 6Ft Choose your Department drop down list - 103 This repeating table is conditional on the drop down values. This works great. Trees     Fruit       Cost   Date Ordered    Date Delivery Department 6Ft        Peaches                                                        103 3Ft        Apples                                                          102 3Ft        Peaches         &

Set read only permissions on a document based on review status

I have a document library that has excel files that users create using a Content Type template.  Then there is a workflow that runs on it and allows the user to change state of the document to Strted, Prepared, Reviewed.  I want that once the status is set to reviewed, a workflow runs and changes the permissions on the document to read only.  The user is part of a group... so not sure how to handle the permission.  Any advice?

Hide Label Based on Label Text?


Is it possible to display or hide a label based on the text rendered in it?
I have a label that will display the value of a control on the previous page. If the value rendered is "0" then I want to hide the label or hide the label and one more label associated with it. (or if the value is more than "0" make it visible)

Any suggestions would be great.


Show or hide programmatically based on audience


I'm trying to either show or hide a datalist control based on a users Audience.

      AudienceLoader audienceLoader = AudienceLoader.GetAudienceLoader();

      string audienceFieldValue = "United States";

      if ((AudienceManager.IsCurrentUserInAudienceOf(audienceLoader, audienceFieldValue, false)))
        DataList2.Visible = true;
        DataList2.Visible = false;

I have tried couple different things this is where I'm at now... any help would be appreciated.




Hide edit button on editform based on whether the user is item's creator


Hi Everyone


I would like to hide/show the edit button on a list item's edit form based on whether the user is the item's creator.  The reason I want to do this is because SharePoint's out-of-the-box behaviour is such that when a user edits someone else's item, the Access Denied page pops up AFTER the user makes his/her edits and presses ok.


My users want the edit button to be hidden so they don't have to go through the steps of making the edits, press ok, and then find out their access is denied.


I have done some research, and the approach I have arrived at is to create my own edit item user control, which has my own cutom code which checks if the user is the creator, and then hide/show the edit button.  I have 2 questions surrounding this:


1) Can anyone provide some advice or resources on the web which describes how to best implement an edit form user control and then integrate it into SharePoint so that the user control is only used on my particular list, and doesn't affect anything else in the site collection.


2) Can anyone suggest another approach perhaps requires less custom development effort than the custom user control approach?

SSRS 2008 R2 - Line chart labels - visibility based on expression?


I would like to control the visibility of a data label in a line chart using an expression. For example, I have a requirement to show the data label for two compariable data points in a line chart where the horizontal axis is time (Q1, Q2, Q3, etc...) and the data points are determined based on a selected parameter. The basic idea is that a user can select to view Q3 as the end point of reporting and the chart will graph a complete time line (e.g. FY 2001 thru FYXX Q3) but only show the label for Q3 and prior year Q3.

I have tried to build an expression in the visibility property of 'Chart Series Labels' but this does not appear to work.


How to hide matrix rows based on values?


I have a matrix settled upon an MDX Query using Reporting Services 2000.
In columns i have the Months and in  the Lines and i have Products, so what i need todo is hide the rows that have a 0 value in all months.

How can this be achieved?

Best Regards,
Luis Simões

i wanted to hide row based on measure


i have 3 material types of ore, waste and HL and 3 measures of tons, grade, metal. i wanted to hide grade and metal row for waste material.

=iif(Fields!Material_Type.value="Waste",true,false) it hides whole waste.

i need to add =iif(Fields!Measure.Value="Tons",false,true) somewhere.

How to hide information based on whether the report is being printed/exported



I have created reports with drill thru functionality. I use a blue foreground and bold font to give the user hints as to what they can drill into.

I would like to be able to turn off the blue, bold, and even the drill thru action when the report is being printed or exported.

I have thought of basing those properties on a hidden/non hidden report (ex. @ShowLinks) parameter, but the best scenario would be if I could determine (via a global variable) whether a report is being exported or printed rather than the user having to remember to set a parameter.

Any ideas?



Show/Hide fields on InfoPath based on context User Group Membership

I am reading a book on SharePoint 2010 Development by Wrox and although it is a good book, the InfoPath section is limited. I am Googling to see if I can find anywhere where i can perhaps have this type of functionality to hide and show a specific field based on their Group Membership?
Victor Palma

Show/Hide Detailviews based on querystring


I have a form that has 2 querystring variables ID and FormID being passed to the page. Also on this page I have 2 different DataSources that outputs to a Detailview depending if the FormID is 1 or 2. I would like to be able to add a show/Hide command to Show only the DetailView that is selected and Hide the other. I have researched and found hat people are using a Multiview code, but I have not been able to find a working example code.  Does any one have any suggestions? I am currently using ASP.Net 2.0 and C#. Thanks for any help? 

Assign unique permissions to an infopath web based form


Hello All,

I am facing this problem which has become a real pain. Whenever I try to assign permissions or try to perform any operation on an infopath web based form (item). I get the following error:

"Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.."

Now thanks to this bottleneck, I cant perform any action on the forms thats facing the mentioned error. My aim is to assign unique permissions on a form item with this error, if I follow the conventional way (at UI Level) of assigning form permissions i get this error screen and cant move  forward. 

How to hide the list column based on user login in SharePoint 2007

Hi, I have two different SharePoint group named 'Sales' group and 'HR' group. In a SharePoint list i have 10 columns. out of it i want to display 8 column for 'Sales' group and to show all the column for 'HR' group. I want to do this base on the user login. How can i achieve this?. Am using SharePoint 2007.

Conditionally Hide Percentage Labels on a 100% Stacked Bar Chart SSRS

I have searched for answers on this topic and the only ones I can find are for pie charts.  What I'd like to do is hide the point labels (percentages) on a 100% stacked bar chart when the percentage is below .05%, otherwise the labels are very cluttered and difficult to read.  I have tried to write an expression to do this, however, since the percentage calculation goes on behind the scenes I cannot find a way to refer to this value.  In addition, I am using #.## "%" for my formatting and am wondering if there is a way to remove the % sign when the label is hidden. Any help would be appreciated.  Thanks.

Hide a calculated member output based on condition


Hello:  New to SSAS.   Is it easy to alter this caluculated MDX to HIDE or not make visibile the output(Average_Response) if Respondents are < 10? 

However, I only want to Hide the value.   It still needs to be used for aggregate calculations.

Thank you!

CREATE MEMBER CURRENTCUBE.[Measures].Average_Response


AS [Measures].[ResponseGiven]/[Measures].[Respondents],


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend