Hi
Have DownLoad , Print buttons on the form. Using below code successfully downloading data to CSV file. I am aware that using
if(User.IsInRole("userRole"))
{
//then do not get the columns specified
//Not sure of the right place/do it
}
Question
Now i like to set few columns to NULL when the users in certain roles trying to download the data
protected void btnDownLoad_Click(object sender, EventArgs e)
{
Response.ContentType = "text/csv";
Response.AddHeader("Content-Disposition", "Attachment;filename=EndUserRecord.csv");
//Get user record DataTable
DataTable dt = GetUserRecord();
//Print column names
foreach (DataColumn column in dt.Columns)
{
Response.Write(column.ToString().ToUpper() + ",") ...
Go to the complete details ...