LookupsUserForm.aspx.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:2k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : LookupsUserForm.cs
  3. // project    : Itenso Web User Forms
  4. // created    : Jani Giannoudis - 2008.10.30
  5. // language   : c#
  6. // environment: .NET 2.0
  7. // copyright  : (c) 2008 by Itenso GmbH, Switzerland
  8. // --------------------------------------------------------------------------
  9. using System;
  10. using System.Web.UI;
  11. using System.Web.UI.WebControls;
  12. using Itenso.WebUserForms.Controls;
  13. using Itenso.WebUserForms.Runtime;
  14. // --------------------------------------------------------------------------
  15. public partial class LookupsPage : System.Web.UI.Page
  16. {
  17. // ------------------------------------------------------------------------
  18. protected override void OnLoad( EventArgs e )
  19. {
  20. // load form control
  21. this.userForm = new UserFormLoader( "~/UserForms/LookupsUserForm.ascx" ).Load();
  22. // lookup
  23. LookupAdapter.Apply( DemoLookupProvider.Instance, this.userForm );
  24. FormPlaceHolder.Controls.Add( this.userForm );
  25. base.OnLoad( e );
  26. } // OnLoad
  27. // ------------------------------------------------------------------------
  28. private void SetEditMode( bool allowEdit )
  29. {
  30. FieldEditEnabler.Enable( this.userForm, allowEdit );
  31. SubmitButton.Enabled = allowEdit;
  32. EditButton.Enabled = !allowEdit;
  33. } // SetEditMode
  34. // ------------------------------------------------------------------------
  35. protected void SubmitButton_Click( object sender, EventArgs e )
  36. {
  37. SetEditMode( false );
  38. } // SubmitButton_Click
  39. // ------------------------------------------------------------------------
  40. protected void EditButton_Click( object sender, EventArgs e )
  41. {
  42. SetEditMode( true );
  43. } // EditButton_Click
  44. // ------------------------------------------------------------------------
  45. protected void ClearLookups_Click( object sender, EventArgs e )
  46. {
  47. DemoLookupProvider.Instance.Clear();
  48. } // ClearLookups_Click
  49. // ------------------------------------------------------------------------
  50. // members
  51. private UserControl userForm;
  52. } // class LookupsPage
  53. // -- EOF -------------------------------------------------------------------