How to restrict user to see limited information by using role manager?http://forums.asp.net/t/1805085.aspx/1?How+to+restrict+user+to+see+limited+information+by+using+role+manager+Sun, 20 May 2012 04:37:45 -040018050854986943http://forums.asp.net/p/1805085/4986943.aspx/1?How+to+restrict+user+to+see+limited+information+by+using+role+manager+How to restrict user to see limited information by using role manager? <p>Hi,</p> <p>I'm a beginner of asp.net and would like to design a web site (using web form) with login authentication. If I use the asp.net role manager, can I implement the below function? Can anyone give me some hints? Many thanks</p> <p>Scenario:</p> <p>There are two inputbox - one is inputbox_A and the other is inputbox_B in one page</p> <p>Requirement:</p> <p>I would like to allow user A can see both inputbox_A and inputbox_B. However, user B can only see the inputbox_A</p> 2012-05-18T11:01:33-04:004987008http://forums.asp.net/p/1805085/4987008.aspx/1?Re+How+to+restrict+user+to+see+limited+information+by+using+role+manager+Re: How to restrict user to see limited information by using role manager? <p>Hi</p> <p>The simplest and quick way would to check if the user is in a given role then disabled (or hide) the textbox they shouldn't be able to access. You can do this in the Page_Load event.</p> <pre class="prettyprint">protected void Page_Load(object sender, EventArgs e) { if (User.IsInRole(&quot;Role1&quot;)) { inputbox_A.Enabled = false; } else if (User.IsInRole(&quot;Role2&quot;)) { inputbox_B.Enabled = false; } }</pre> <p><br> Hope this helps,<br> Stuart&nbsp;</p> <p></p> <p></p> 2012-05-18T11:33:42-04:004987192http://forums.asp.net/p/1805085/4987192.aspx/1?Re+How+to+restrict+user+to+see+limited+information+by+using+role+manager+Re: How to restrict user to see limited information by using role manager? <p>Hello,</p> <p>You can do something like this</p> <pre class="prettyprint">protected void Page_Load(object sender, EventArgs e) { if(User.IsInRole(&quot;RoleB&quot;)) { inputbox_B.Visible= false; } }</pre> 2012-05-18T13:27:43-04:004988411http://forums.asp.net/p/1805085/4988411.aspx/1?Re+How+to+restrict+user+to+see+limited+information+by+using+role+manager+Re: How to restrict user to see limited information by using role manager? <p>thanks, I will try this</p> 2012-05-20T04:37:45-04:00