How To Hide A Object To Some Particular Users Without Using Code

Feb 6, 2010

i need to hide an object(any control)on .aspx page for a perticulat user,

For Example::

I have two controls one is a lable control and another one is a button control on my Default.aspx page, and there are two users A and B, Lables control can be visible for A and B. But Button control is only visible for A but not to B. to do this i dont have to use any C# or VB code.

View 9 Replies


Similar Messages:

AJAX :: Calendar Extender Does Not Hide When Users Clicks Outside

Aug 13, 2010

The calendar extender is designed to automatically hide when the user clicks out side of it. [URL]. However, in the markup below that isn't happening. The click outside is ignored forcing the user to select a date to make it hide.
[Code]....

View 4 Replies

Security :: Trying To Hide The Admin Files From Normal Users?

Nov 30, 2010

I am trying to hide the admin files from normal users, however I get the following error:

Error 11 Unrecognized configuration section siteMap.C:projectsFamilyPhotoAlbum_VS_2010web.config 137

Below is the web.config:

<?xml version="1.0"?>
<!--
&nbsp;&nbsp;&nbsp; Note: As an alternative to hand editing this file you can use the
&nbsp;&nbsp;&nbsp; web admin tool to configure settings for your application. Use
&nbsp;&nbsp;&nbsp; the Website->Asp.Net Configuration option in Visual Studio.
&nbsp;&nbsp;&nbsp; A full list of settings and comments can be found in
&nbsp;&nbsp;&nbsp; machine.config.comments usually located in
&nbsp;&nbsp;&nbsp; WindowsMicrosoft.NetFrameworkv2.xConfig

[Code]....

View 4 Replies

Web Forms :: Hide / Show CheckBoxList Depending On Users Profile

Nov 16, 2010

New users can register on my site by completing a basic form that has the create user wizard control with some additional information i am collecting using a CheckBox List. They can then log in to the site and and view "MypProfilePage.aspx" where I display the information with the CheckBoxList boxes already ticked based their selections which they can update. My problem is I have two levels of User and each one has a different registration form.

Registration Form A
Has 20 Items in the CheckBox List

Registration Form B
Has 10 items in the CheckBox List

On the Profile Page, I just want to show the CheckBox which is relevant to the Registration form A or B and with selections by the registered user. So therefore the User who registered on B will not be able to see the selections checkbox list for A.

View 6 Replies

Data Controls :: Hide Delete Button In ListView For Non Logged In Users

Jul 24, 2012

I have a ListView in my system.. 

And inside it, there is a button called "Delete". 

In the behind code, I tried to access the button control in the listview. However, the code keep looping non-stop..  

The logic is the Delete button will only be visible by the current logged-in user. And I had already set the button as visible = false. I had set breakpoint to the line : Delete.Visible = true;. Once the execution reach here, it loop back to the first line again..  

And Delete button remain invisble despite the execute visible = true statement.. 
 
Here is the code: 

protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e)
{
MembershipUser currentUser = Membership.GetUser();
Guid currentUserId = (Guid)currentUser.ProviderUserKey;

[Code].....

View 1 Replies

AJAX :: How To Hide The "edit" And "delete" Links/Object Reference Not Set To An Instance Of An Object

Mar 12, 2010

I am using the ajax reorderlist control from the latest Ajax Control toolkit. Based on the logged on user, I need to hide the "edit" and "delete" links. They should be visible to admin, and not visible to others. I used to control this when I was using a gridview just by calling the column and setting it's visible property to false. I have tried using:

ReorderListMinutes.TemplateControl.FindControl("lnkDeleteAgendaItem").Visible =
False

ReorderListMinutes.TemplateControl.FindControl("lnkEdit").Visible =
False

This returns an error of the dreaded "Object reference not set to an instance of an object."

View 1 Replies

Object Reference Not Set To An Instance Of An Object. Error Will Shown In This Code?

Dec 1, 2010

When i run the following code it the error as :

""Object reference not set to an instance of an object.""
Protected Sub CreateUserWizard1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.Load
Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True")
Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT TOP 1 EmployeeId FROM a1_admins Order by Id DESC", SQLData)
Dim label11 As Label = CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Label11")
SQLData.Open()
Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader()
If dtrReader.HasRows Then
While dtrReader.Read()
label11.Text = dtrReader("EmployeeId")
End While
End If
dtrReader.Close()
SQLData.Close()
End Sub
End Class

View 3 Replies

ADO.NET :: Object Refernce Not Set To An Instance Of An Object Error In The Code?

Oct 21, 2010

I'm getting the object refernce not set to an instance of an object error in the code below.I couldnt figure it out, where I'm going wrong.VB.NET Syntax (Toggle Plain Text)

View 3 Replies

How To Use Linq To Object To Hide Or Show Some Control In Page

Aug 11, 2010

I am creating a function to hide all the gridview controls except the control whose name is being passed in the function.

Here this.Controls referes to controls present in the page (At compilation error is thrown although). I want to fetch all the controls of type GridView with Name property not equal to the one passed in the funtion.

Now after getting a collection of GridView. I want to hide all the grids

private void HideGridView(string gridToShow)
{
GridView[] result = from control in this.Controls
where control.GetType() == typeof(GridView) && control.Name !=gridToShow
select control as GridView;
foreach (var control in result)
control.Visible = false;
}

At comile time it shows me this.Control as invalid because it is not a collection.

How can I achieve this on a web application

EDIT:

private void HideGridView(string gridToShow)
{
(from control in this.Controls.OfType<GridView>
where control.Name !=gridToShow
select control).ToList().ForEach(gv=>gv.Visible=false);
}

Here is the code I wrote, shows me an error: GridView is a type but used like a variable (Compile time error).
And at where Invalid Expression Term 'where'

View 2 Replies

HttpHandlers / Modules :: URLHandler Code / Getting "Object Reference Not Set To An Instance Of An Object." Error

Feb 8, 2010

Everything works fine on my dev machine which is running Windows 7. However, when I deploy my app to my production server at MaximumASP running 64 bit Windows 2008 R2 Standard, I just can't access those pages that are handled by my URL Routing logic. I'm getting the infamous "Object reference not set to an instance of an object." error.

The code below is my URL handler for Mailbox module in my application. I've defined mail folders in my database. All this does is if user is looking for /mailbox/Inbox, it looks up the folderID and sends the user the mailbox.aspx page which is expecting a folderID

[Code]....

And this is the part in Global.asax

[Code]....

And finally, the code in the mailbox page:

[Code]....

View 2 Replies

Web Forms :: Hide Some Menu Items For Non Logged In Users In Menu Control

Apr 8, 2013

What I want is to show menu items Administrator or show user menu items.Show menu items using login...How I can do it with role  provider, control menu and siteMap in masterpage?

View 1 Replies

Difference Between Object Code And Embedded Code?

Aug 26, 2010

i have a doubt difference between object code and embeded code .

View 2 Replies

Security :: Calling Users NetworkCredential Object From The WCF Service And Pass It To The OCS Call?

Aug 27, 2010

I have the following scenario. An user uses the desktop application to call our WCF Service which has windows authentication. The WCF Service calls the Office Communication Server (OCS) in order to do some custom work.

When the WCF Service calls OCS we have to pass an instance of NetWorkCredential into the call. I want to pass in the original calling users NetworkCredential object into the OCS call rather than constructing it using a custom username and password. How do I get access to the calling users NetworkCredential object from the WCF service and pass it to the OCS call?

View 1 Replies

Java Script To Hide Column - Can't Use Code Behind?

Feb 9, 2010

I am looking for a solution to a Java Script question. My question is this, I have a gridview, and in this gridview I have a column, which I use as a flag. The gridview itself is dynamically added to a user control and then to the page. What I would like to do is to use Java Script to hide this column, but I do not know how to do this. Unfortunately, I cannot use code behind, because of the gridview being dynamically added. Also, I have one further question, I already have some Java Script code that can hide some of the rows based upon the values in my column when a button is clicked. What I want to do is when the page is loaded for the first time, to hide some of these rows, and to use the button in reverse to reveal them again. How do I achieve this?

View 5 Replies

AJAX :: ModalPopUp Show And Hide From Code Behind?

Feb 10, 2010

I have a column within my gridview that displays status of the records. Certain records we need to prompt for additonal information and confirmation so we are using a modalpopup, but other records dont need the popup, so how can i disable or prevent the modalpopup from opening for those records?

Here is my template column for that field:

[Code]....

within my onclick="hypHT_Click" event im doing a simple modalpopup.Show(); how can i check the gridview in order to determine if i need to show it or just disable it.

View 1 Replies

How To Hide Script And Source Code From Viewing

Feb 26, 2011

i am trying to find a way by using it i could hide my web page scripts and source code to be viewed by other and for safe keeping

is it possible or not?

can we applying some kind of encoding using IIS along with ASP .Net on pages that would decode when the page is posted back to server ?

View 6 Replies

C# - Hide Next Button From Code Behind In Wizard Control?

Mar 16, 2011

I have asp.net page that having the wizard control. I wanted to make visible false Next Button when other than Admin logged in (say dealer,subdealer log in). How to make it invisible or to change its text . I tried this line to make it in visible :

[Code]....

but sounds nothing there. what have to do ?

View 1 Replies

Hide ListView Table Header From The Code Behind

Feb 13, 2010

I want to hide a column of ListView based on the role from the code behind. Here's the mark-up and the code:

<asp:ListView ID="lvTimeSheet" runat="server">
<LayoutTemplate>
<table id="TimeSheet">
<thead>
<tr>.....

But that column id="thDelete" is visible all the time. How do I go about hiding the column based on some condition from the code behind?

View 1 Replies

Use GET And When POST - Hide Query String On Code

Feb 11, 2010

When to use GET and when POST. I want to hide my query string on code like :

protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("~/Page1.aspx?mode=Create");
}

I don't want to show Create word in query string . What i have to do. And how to implement the Post/Redirect/Get pattern .Please send me code for this if possible.

View 2 Replies

AJAX :: ModalPopupExtender.Hide() And Executing Other Code In Codebehind?

May 1, 2010

In a button click, I need to be able to hide my ModalPanel and then continue running other code server-side. I currently have it this way:

[Code]....

It hides the panel at the of the event handler because that's when the page posts back. So what can I do to hide the panel and then continue running the rest of the server-side code?

Basically what I'm trying to do is the following:

1. Button_display in my webform simply displays my UpdatePanel via ModalPopupExtender.

2. Button_closePanel_Click will hide my UpdatePanel and then run some server-side code, which would display my UpdateProgress control.

protected void Button_closePanel_Click(object sender, EventArgs e)

View 2 Replies

Custom Server Controls :: How To Hide Code From Exception

Feb 24, 2010

I have a custom control. Some properties throw a custom error message when no value is supplied. The message shows up fine, but also does the code. For example ...

Custom Message Here

... and then in the yellow box the code ...

throw new Exception("Custom Message Here");

How can I hide the code portion?

View 1 Replies

Data Controls :: Hide Particular Column In GridView In Code Behind

Jan 1, 2014

I have two columns in gridview

CustomerId                   CustomerName

Now how to hide column CustomerId programmatically??

View 1 Replies

Make To Hide On Buttonclick / Event Code The Intelligsense Does Not Give The Id Name?

Nov 17, 2010

I have a <hr/> on the page and I want to hide it on buttonclick ?

How to do it ?

I tried to capture it within div and give ID to div but in buttonclick event code the intelligsense does not give me the id name for me to use.

What should I do?

View 1 Replies

C# - Put Code To Redirect Users Without A Session To The Homepage?

Feb 4, 2011

I have a web app with loads of pages and most of them require some session variables in order to function.

i want to put some defensive code in my app. where is the best place to put somethign like:

if (Session.Count == 0){
Response.Redirect("~/default.aspx");
}

EDIT: how do i check if the current page is defult.aspx?

View 5 Replies

Asp Code For Sending Bulk Emails For Various Users?

May 24, 2010

i am a new comer in asp.i needed asp code for sending bulk emails for various users.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved