Click here to Skip to main content
16,012,107 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear sir,

how to hide (or,/) Remove column in List View control while selecting Role in asp.net

for example:

I am login for Administrator's Role Listview generate 5 columns

if i am login for Owner's Role ListView generate only 3 columns

Note: Table same for all roles.

How to solve this problem.(How to hide this two columns)

Help me anyone known,

By mohan.
Posted
Updated 13-Dec-11 1:31am
v2

here role id refers to your database value for particular user..so 0="admin",1="owner"..hide in user control where u have done in your master page to displaylistview..

if (Session["USER_NAME"] == null)
        {
            Response.Redirect("../login.aspx");
        }
        else if ((Session["ROLE_ID"].ToString() != "0")&&(Session["ROLE_ID"].ToString() != "1"))
        {
            string errormsg = "You are not Authorized";
            string url = "../login.aspx?errmsg=" + errormsg;
            Response.Redirect(url);
        }


update me if error occurs..
 
Share this answer
 
v2
Hi,

i do not have code but i can give you basic idea about your problem,

as Code89 mention you can have two user Admin and Owner

now on condition you can assign different dataset to your grid view. that way you can fulfill your requirement.

thanks
-amit.
 
Share this answer
 

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