Posted By

emregulcan on 03/03/10


Tagged

c text binding Eval


Versions (?)

Change "Eval" Value


 / Published in: C#
 

You can change your dynamic binding eval text with this method. This method should be in same codebehind

  1. //Codebehind method
  2. public string ChangeValue(string val)
  3. {
  4. string ret= string.Empty;
  5.  
  6. if (val== "True")
  7. {
  8. ret= "In Stock";
  9. }
  10. else
  11. {
  12. ret= "Not in stock";
  13. }
  14.  
  15. return ret;
  16. }
  17.  
  18.  
  19.  
  20.  
  21. Replace your Eval in ASP.NET page (in example this is a label)
  22.  
  23. <asp:Label ID="Label3" runat="server" Text='<%# ChangeValue(Eval("isStock").ToString())%>'></asp:Label>

Report this snippet  

You need to login to post a comment.