How can I insert a css class
in the .ashx file while the .aspx UI page displays it as a string
?
What is the method to include css
in the code behind of the .ashx page?
I would like the text "Cook" to be displayed in red.
Problem:
https://i.sstatic.net/wweT7.png
try
{
for (int i = 0; i < dsSeaech.Tables[0].Rows.Count; i++)
{
var myString = new StringBuilder();
myString.Append("<span style=\"color:red\">(Cook)</span>");
lstRecipeName.Add(dsSeaech.Tables[0].Rows[i]["RecipeName"].ToString());
if (Convert.ToInt32(dsSeaech.Tables[0].Rows[i]["UserType"]) == AppConstant.chefuser)
{
lstChefName.Add(dsSeaech.Tables[0].Rows[i]["FullName"].ToString() + "(" + "Chef" + ")");
}
else if (Convert.ToInt32(dsSeaech.Tables[0].Rows[i]["UserType"]) == AppConstant.cook)
{
lstChefName.Add(dsSeaech.Tables[0].Rows[i]["FullName"].ToString() + myString);
}
}
JavaScriptSerializer js = new JavaScriptSerializer();
context.Response.Write(js.Serialize(lstRecipeName));
}
catch (Exception ex)
{
throw ex;
}