Skip to content
Loading
 
+2
  • Sachin Singh
    +1
    the best way is to define business rule for it
    1. Public Class YourClass  
    2. {  
    3. public string PtwContenet {get;set;}  
    4.   
    5. private string _Color ;  
    6.   
    7. public string Color   
    8. get{_color=value;}  
    9. set{ if(PtwContent==null){  
    10. _Color="Yellow";  
    11. }else  
    12. {  
    13. _color=value;  
    14. } 
     now in html
    1. something 
     In this way you do not need to worry about color anymore
    also if in future you need to change color then insted of changing UI you can manipulate through Class property.
    +1