Utils.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /**
  2. * Namespace: System.Web.UI
  3. * Class: Utils
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer-> [email protected]
  7. * Implementation: yes
  8. * Contact: <[email protected]>
  9. * Status: ??%
  10. *
  11. * (C) Gaurav Vaish (2001)
  12. */
  13. using System;
  14. using System.Reflection;
  15. namespace System.Web.UI
  16. {
  17. internal class Utils
  18. {
  19. internal static object InvokeMethod(MethodInfo info, object obj, object[] parameters)
  20. {
  21. object retVal = null;
  22. try
  23. {
  24. retVal = info.Invoke(obj, parameters);
  25. } catch(TargetInvocationException tie)
  26. {
  27. throw tie.InnerException;
  28. }
  29. return retVal;
  30. }
  31. internal static string GetClientValidatedEvent(Page page)
  32. {
  33. return "if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate();";
  34. }
  35. internal static string GetClientValidatedPostBack(Control control)
  36. {
  37. return (" { if (typeof(Page_ClientValidate) != 'function' || Page_ClientValidate()) " +
  38. control.Page.GetPostBackEventReference(control) +
  39. " } " );
  40. }
  41. }
  42. }