I have two types of users for the website, admin and non-admin. Both users can edit the data using the edit form, but only admin can edit the password textbox. I plan to make the text box visible only to the admin
During painting the edit form, the application should check whether the user is an admin (using a variable stored in Default.aspx.cs) and change the value for the Visible properties for the textbox accordingly.
Can anyone tell me how to do this. The code above wouldn't compile and I'm a newbie in web programming.
Thanks.
During painting the edit form, the application should check whether the user is an admin (using a variable stored in Default.aspx.cs) and change the value for the Visible properties for the textbox accordingly.
<
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
Text='<%# Bind("Password") %>' Visible='<%# if (loggedInUser == admin) {true;} else {false;} %>' ></
asp:TextBox
>
Can anyone tell me how to do this. The code above wouldn't compile and I'm a newbie in web programming.
Thanks.