ButtonDesigner.cs 749 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Namespace: System.Web.UI.Design.WebControls
  3. * Class: ButtonDesigner
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. *
  8. * (C) Gaurav Vaish (2002)
  9. */
  10. using System;
  11. using System.Web;
  12. using System.Web.UI.WebControls;
  13. using System.Web.UI.Design;
  14. namespace System.Web.UI.Design.WebControls
  15. {
  16. public class ButtonDesigner : TextControlDesigner
  17. {
  18. public ButtonDesigner(): base()
  19. {
  20. }
  21. public override string GetDesignTimeHtml()
  22. {
  23. if(Component != null && Component is Button)
  24. {
  25. Button btn = (Button)Component;
  26. btn.Text = btn.Text.Trim();
  27. if(btn.Text.Length == 0)
  28. {
  29. btn.Text = "[" + btn.ID + "]";
  30. }
  31. return base.GetDesignTimeHtml();
  32. }
  33. return String.Empty;
  34. }
  35. }
  36. }