Click here to Skip to main content
15,885,985 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Here i am doing display one error Message like "politisians should not be lazy" like below. so i am getting default fore color (black)of error Message . i need red color...

default = politisians should not be lazy

need = politisians should not be lazy

C#
try
{
         IndiaAssemblies.ForEach(delegate(Indiaassembly e)
         {
                  if (string.IsNullOrEmpty(e.politisians))
                  {
                          throw new     System.DataMisalignedException("politisians should not be lazy");
                  }
         });
 }
catch (Exception ex)
{
         return RedirectToAction("Indiaparlement", "INDIA", new { somex = objindia.somex.ToString(),
            Revision = objindia.Revision.ToString(), errormsg = ex.Message });
}

Thanks
Hareesh
Posted
Updated 5-Jan-15 2:24am
v2
Comments
Praveen Kumar Upadhyay 5-Jan-15 8:25am    
RedirectToAction will redirect you to the action of a controller which you have mentioned. In the view of your action, change the font color of the text.

1 solution

A string in itself has no colour - it only gets a colour when you present it to the user, via a control of some form. As as string, it is only a collection of characters and has no "display" attributes such as size, color, font and so on.

And all of the various controls will decide for themselves what properties control colour, and when it should be applied. Changing a single cell in a DataGridView to red text is a different process to changing it in a label, for example. And doing it in a website will be different to doing it in a console application!

Look at how you are presenting the text to the user, and look at how that control uses colour - we can't tell you "Do this" and it'll be in Red for all systems and controls.
 
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