2 // System.Web.UI.PostBackOptions.cs
5 // Sanjay Gupta (gsanjay@novell.com)
7 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.ComponentModel;
34 namespace System.Web.UI
36 public sealed class PostBackOptions
38 private Control control;
39 private string argument;
40 private string actionUrl;
41 private bool autoPostBack;
42 private bool requiresJavaScriptProtocol;
43 private bool trackFocus;
44 private bool clientSubmit;
45 private bool performValidation;
46 private string validationGroup;
48 public PostBackOptions (Control control) : this (control, null, null, false, true, false,
53 public PostBackOptions (Control control, string argument) : this (control, argument, null, false,
54 true, false, true, false, null)
58 public PostBackOptions (Control control, string argument, string actionUrl, bool isAutoPostBack,
59 bool isJavaScriptProtocolRequired, bool isTrackFocus, bool isClientSubmit,
60 bool isValidationPerformed, string validatingGroup)
62 this.control = control;
63 this.argument = argument == null ? String.Empty : argument;
64 this.actionUrl = actionUrl == null ? String.Empty : actionUrl;
65 this.autoPostBack = isAutoPostBack;
66 this.requiresJavaScriptProtocol = isJavaScriptProtocolRequired;
67 this.trackFocus = isTrackFocus;
68 this.clientSubmit = isClientSubmit;
69 this.performValidation = isValidationPerformed;
70 this.validationGroup = validatingGroup == null ? String.Empty : validatingGroup;
74 public string ActionUrl {
75 get { return actionUrl; }
76 set { actionUrl = value; }
80 public string Argument {
81 get { return argument; }
82 set { argument = value; }
85 [MonoTODO ("Implement support for this in Page")]
86 [DefaultValue (false)]
87 public bool AutoPostBack {
88 get { return autoPostBack; }
89 set { autoPostBack = value; }
93 public bool ClientSubmit {
94 get { return clientSubmit; }
95 set { clientSubmit = value; }
98 [DefaultValue (false)]
99 public bool PerformValidation {
100 get { return performValidation; }
101 set { performValidation = value; }
104 [DefaultValue (true)]
105 public bool RequiresJavaScriptProtocol {
106 get { return requiresJavaScriptProtocol; }
107 set { requiresJavaScriptProtocol = value; }
110 [DefaultValue (null)]
111 public Control TargetControl {
112 get { return control; }
115 [MonoTODO ("Implement support for this in Page")]
116 [DefaultValue (false)]
117 public bool TrackFocus {
118 get { return trackFocus; }
119 set { trackFocus = value; }
122 [MonoTODO ("Implement support for this in Page")]
124 public string ValidationGroup {
125 get { return validationGroup; }
126 set { validationGroup = value; }
129 // Returns true if some of these options must be handled by
131 internal bool RequiresSpecialPostBack {
133 return actionUrl != null ||
134 validationGroup != null ||