Click here to Skip to main content
15,912,069 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I am creating a web page. I want to restrict the visibility of the link button to the particular users. There is no login page, and user information has to be capture from windows login. The users who all able to view the link has to be managed in the web.config file. How can I do it.

THANK yOU
Posted
Comments
Denis Shemenko 8-Jul-13 3:24am    
Any Ideas???

Have you tried to think about the problem before posting a question?
Why you searching for easiest way? If you search any complete solution - Go and Google.

If you cant find ready-to-use solution - Go and Think.

After your thinking there are will be ideas how to solve the problem.

Then you have 2 ways:
- Post your idea, and listen to what the others says;
- Try implement your idea, and when you got stuck - Post your experiences.

Your task - is a very simple task, but you dont want to strain your brain.
Then follows a last question:
How it be a programmer without love to Thinking?
_Asif_ 8-Jul-13 3:46am    
could not agree more with Denish. Good advice!

1 solution

1) Add one key in AppSettings in web.config file as
HTML
<add key="IsVisible" value="1" />

2) In page.cs where that button resides check key value as
C#
bool IsVisible = ConfigurationManager.AppSettings["IsVisible"].ToString() ;
if(IsVisible = "1") 
{
   yourbutton.Visible = true;
}
else
{
   yourbutton.Visible = false;
}


Hope this helps!!
 
Share this answer
 
Comments
sumit_kapadia 9-Jul-13 6:11am    
Sorry forgot to say
add
using System.Configuration;
in .cs file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900