Link.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /**
  2. * Project : Mono
  3. * Namespace : System.Web.UI.MobileControls
  4. * Class : Link
  5. * Author : Gaurav Vaish
  6. *
  7. * Copyright : 2003 with Gaurav Vaish, and with
  8. * Ximian Inc
  9. */
  10. using System;
  11. using System.Collections;
  12. using System.Web.UI;
  13. using System.Web.Mobile;
  14. namespace System.Web.UI.MobileControls
  15. {
  16. public class Link : MobileControl, IPostBackEventHandler
  17. {
  18. public Link()
  19. {
  20. }
  21. void IPostBackEventHandler.RaisePostBackEvent(string argument)
  22. {
  23. MobilePage.ActiveForm = MobilePage.GetForm(argument);
  24. }
  25. public override void AddLinkedForms(IList linkedForms)
  26. {
  27. string url = NavigateUrl;
  28. string pref = Constants.FormIDPrefix;
  29. if(url.StartsWith(pref))
  30. {
  31. url = url.Substring(pref.Length);
  32. Form toAdd = ResolveFormReference(url);
  33. if(toAdd != null && !toAdd.HasActiveHandler())
  34. linkedForms.Add(toAdd);
  35. }
  36. }
  37. public string NavigateUrl
  38. {
  39. get
  40. {
  41. object o = ViewState["NavigateUrl"];
  42. if(o != null)
  43. return (string)o;
  44. return String.Empty;
  45. }
  46. set
  47. {
  48. ViewState["NavigateUrl"] = value;
  49. }
  50. }
  51. public string SoftkeyLabel
  52. {
  53. get
  54. {
  55. object o = ViewState["SoftkeyLabel"];
  56. if(o != null)
  57. return (string)o;
  58. return String.Empty;
  59. }
  60. set
  61. {
  62. ViewState["SoftkeyLabel"] = value;
  63. }
  64. }
  65. }
  66. }