2 // System.Web.UI.Control.cs
5 // Bob Smith <bob@thestuff.net>
6 // Gonzalo Paniagua Javier (gonzalo@ximian.com
7 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
8 // Sanjay Gupta (gsanjay@novell.com)
11 // (c) 2002,2003 Ximian, Inc. (http://www.ximian.com)
12 // (C) 2004 Novell, Inc. (http://www.novell.com)
16 // Permission is hereby granted, free of charge, to any person obtaining
17 // a copy of this software and associated documentation files (the
18 // "Software"), to deal in the Software without restriction, including
19 // without limitation the rights to use, copy, modify, merge, publish,
20 // distribute, sublicense, and/or sell copies of the Software, and to
21 // permit persons to whom the Software is furnished to do so, subject to
22 // the following conditions:
24 // The above copyright notice and this permission notice shall be
25 // included in all copies or substantial portions of the Software.
27 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
28 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
29 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
30 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
31 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
32 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
33 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37 using System.Collections;
38 using System.ComponentModel;
39 using System.ComponentModel.Design;
40 using System.ComponentModel.Design.Serialization;
42 using System.Web.Util;
44 namespace System.Web.UI
46 [DefaultProperty ("ID"), DesignerCategory ("Code"), ToolboxItemFilter ("System.Web.UI", ToolboxItemFilterType.Require)]
47 [ToolboxItem ("System.Web.UI.Design.WebControlToolboxItem, " + Consts.AssemblySystem_Design)]
48 [Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
49 [DesignerSerializer ("Microsoft.VSDesigner.WebForms.ControlCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner,
50 "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design)]
51 public class Control : IComponent, IDisposable, IParserAccessor, IDataBindingsAccessor
53 , IUrlResolutionService, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor
56 static readonly object DataBindingEvent = new object();
57 static readonly object DisposedEvent = new object();
58 static readonly object InitEvent = new object();
59 static readonly object LoadEvent = new object();
60 static readonly object PreRenderEvent = new object();
61 static readonly object UnloadEvent = new object();
62 static string[] defaultNameArray;
66 ControlCollection _controls;
67 IDictionary _childViewStates;
68 Control _namingContainer;
74 EventHandlerList _events;
75 RenderMethod _renderMethodDelegate;
78 DataBindingCollection dataBindings;
79 Hashtable pendingVS; // may hold unused viewstate data from child controls
84 const int ENABLE_VIEWSTATE = 1;
85 const int VISIBLE = 1 << 1;
86 const int AUTOID = 1 << 2;
87 const int CREATING_CONTROLS = 1 << 3;
88 const int BINDING_CONTAINER = 1 << 4;
89 const int AUTO_EVENT_WIREUP = 1 << 5;
90 const int IS_NAMING_CONTAINER = 1 << 6;
91 const int VISIBLE_CHANGED = 1 << 7;
92 const int TRACK_VIEWSTATE = 1 << 8;
93 const int CHILD_CONTROLS_CREATED = 1 << 9;
94 const int ID_SET = 1 << 10;
95 const int INITED = 1 << 11;
96 const int INITING = 1 << 12;
97 const int VIEWSTATE_LOADED = 1 << 13;
98 const int LOADED = 1 << 14;
99 const int PRERENDERED = 1 << 15;
104 defaultNameArray = new string [100];
105 for (int i = 0 ; i < 100 ; i++)
106 defaultNameArray [i] = "_ctrl" + i;
111 stateMask = ENABLE_VIEWSTATE | VISIBLE | AUTOID | BINDING_CONTAINER | AUTO_EVENT_WIREUP;
112 if (this is INamingContainer)
113 stateMask |= IS_NAMING_CONTAINER;
116 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
117 [EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
\r
118 public Control BindingContainer {
120 Control container = NamingContainer;
121 if ((container.stateMask & BINDING_CONTAINER) == 0)
122 container = container.BindingContainer;
127 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
129 [WebSysDescription ("An Identification of the control that is rendered.")]
\r
130 public virtual string ClientID {
\r
132 string client = UniqueID;
\r
134 if (client != null)
\r
135 client = client.Replace (':', '_');
\r
141 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
143 [WebSysDescription ("The child controls of this control.")]
\r
144 public virtual ControlCollection Controls //DIT
\r
148 if (_controls == null) _controls = CreateControlCollection();
\r
153 [DefaultValue (true), WebCategory ("Behavior")]
154 [WebSysDescription ("An Identification of the control that is rendered.")]
\r
158 public virtual bool EnableViewState {
159 get { return ((stateMask & ENABLE_VIEWSTATE) != 0); }
160 set { SetMask (ENABLE_VIEWSTATE, value); }
163 [MergableProperty (false), ParenthesizePropertyName (true)]
164 [WebSysDescription ("The name of the control that is rendered.")]
\r
166 [Filterable (true), Themeable (true)]
169 public virtual string ID {
\r
171 return (((stateMask & ID_SET) != 0) ? _userId : null);
180 NullifyUniqueID ();
\r
184 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
186 [WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]
\r
187 public virtual Control NamingContainer {
189 if (_namingContainer == null && _parent != null) {
190 if ((_parent.stateMask & IS_NAMING_CONTAINER) == 0)
191 _namingContainer = _parent.NamingContainer;
193 _namingContainer = _parent;
196 return _namingContainer;
200 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
202 [WebSysDescription ("The webpage that this control resides on.")]
\r
206 public virtual Page Page //DIT
\r
210 if (_page == null && _parent != null) _page = _parent.Page;
\r
219 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
221 [WebSysDescription ("The parent control of this control.")]
\r
222 public virtual Control Parent //DIT
\r
230 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
231 [EditorBrowsable (EditorBrowsableState.Advanced), Browsable (false)]
232 [WebSysDescription ("The site this control is part of.")]
\r
233 public ISite Site //DIT
\r
245 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
247 [WebSysDescription ("A virtual directory containing the parent of the control.")]
248 public virtual string TemplateSourceDirectory {
249 get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }
252 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
254 [WebSysDescription ("The unique ID of the control.")]
\r
255 public virtual string UniqueID {
\r
257 if (uniqueID != null)
\r
260 if (_namingContainer == null) {
\r
264 if (_userId == null)
\r
265 _userId = _namingContainer.GetDefaultName ();
\r
267 string prefix = _namingContainer.UniqueID;
\r
268 if (_namingContainer == _page || prefix == null) {
\r
269 uniqueID = _userId;
\r
273 uniqueID = prefix + ":" + _userId;
\r
278 void SetMask (int m, bool val)
286 [DefaultValue (true), Bindable (true), WebCategory ("Behavior")]
287 [WebSysDescription ("Visiblity state of the control.")]
291 public virtual bool Visible {
293 if ((stateMask & VISIBLE) == 0)
297 return _parent.Visible;
303 if ((value && (stateMask & VISIBLE) == 0) ||
304 (!value && (stateMask & VISIBLE) != 0)) {
305 if (IsTrackingViewState)
306 stateMask |= VISIBLE_CHANGED;
309 SetMask (VISIBLE, value);
313 protected bool ChildControlsCreated {
314 get { return ((stateMask & CHILD_CONTROLS_CREATED) != 0); }
316 if (value == false && (stateMask & CHILD_CONTROLS_CREATED) != 0)
319 SetMask (CHILD_CONTROLS_CREATED, value);
324 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
325 protected virtual HttpContext Context //DIT
\r
329 HttpContext context;
\r
330 if (_context != null)
\r
332 if (_parent == null)
\r
333 return HttpContext.Current;
\r
334 context = _parent.Context;
\r
335 if (context != null)
\r
337 return HttpContext.Current;
\r
340 protected EventHandlerList Events //DIT
\r
344 if (_events == null)
\r
346 _events = new EventHandlerList();
\r
351 protected bool HasChildViewState //DIT
\r
355 if (_childViewStates == null) return false;
\r
360 protected bool IsTrackingViewState {
\r
361 get { return ((stateMask & TRACK_VIEWSTATE) != 0); }
365 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
366 [WebSysDescription ("ViewState")]
367 protected virtual StateBag ViewState
\r
371 if(_viewState == null)
\r
372 _viewState = new StateBag (ViewStateIgnoresCase);
\r
374 if (IsTrackingViewState)
\r
375 _viewState.TrackViewState ();
\r
382 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
383 protected virtual bool ViewStateIgnoresCase
\r
390 internal bool AutoEventWireup {
391 get { return (stateMask & AUTO_EVENT_WIREUP) != 0; }
392 set { SetMask (AUTO_EVENT_WIREUP, value); }
395 internal void SetBindingContainer (bool isBC)
397 SetMask (BINDING_CONTAINER, isBC);
400 internal void ResetChildNames ()
\r
402 defaultNumberID = 0;
\r
405 string GetDefaultName ()
408 if (defaultNumberID > 99) {
409 defaultName = "_ctrl" + defaultNumberID++;
411 defaultName = defaultNameArray [defaultNumberID++];
416 void NullifyUniqueID ()
\r
419 if (!HasControls ())
\r
422 foreach (Control c in Controls)
423 c.NullifyUniqueID ();
426 protected internal virtual void AddedControl (Control control, int index)
\r
428 /* Ensure the control don't have more than 1 parent */
429 if (control._parent != null)
430 control._parent.Controls.Remove (control);
432 control._parent = this;
433 control._page = _page;
434 Control nc = ((stateMask & IS_NAMING_CONTAINER) != 0) ? this : NamingContainer;
437 control._namingContainer = nc;
438 if (control.AutoID == true && control._userId == null)
439 control._userId = nc.GetDefaultName () + "a";
442 if ((stateMask & (INITING | INITED)) != 0)
443 control.InitRecursive (nc);
445 if ((stateMask & (VIEWSTATE_LOADED | LOADED)) != 0) {
446 if (pendingVS != null) {
447 object vs = pendingVS [index];
449 pendingVS.Remove (index);
450 if (pendingVS.Count == 0)
453 control.LoadViewStateRecursive (vs);
458 if ((stateMask & LOADED) != 0)
459 control.LoadRecursive ();
461 if ((stateMask & PRERENDERED) != 0)
462 control.PreRenderRecursiveInternal ();
465 protected virtual void AddParsedSubObject(object obj) //DIT
\r
467 WebTrace.PushContext ("Control.AddParsedSubobject ()");
\r
468 Control c = obj as Control;
\r
469 WebTrace.WriteLine ("Start: {0} -> {1}", obj, (c != null) ? c.ID : String.Empty);
\r
470 if (c != null) Controls.Add(c);
\r
471 WebTrace.WriteLine ("End");
\r
472 WebTrace.PopContext ();
\r
475 protected void BuildProfileTree(string parentId, bool calcViewState)
\r
480 protected void ClearChildViewState ()
485 protected virtual void CreateChildControls() {} //DIT
\r
486 protected virtual ControlCollection CreateControlCollection() //DIT
\r
488 return new ControlCollection(this);
\r
491 protected virtual void EnsureChildControls ()
493 if (ChildControlsCreated == false && (stateMask & CREATING_CONTROLS) == 0) {
494 stateMask |= CREATING_CONTROLS;
495 CreateChildControls();
496 ChildControlsCreated = true;
497 stateMask &= ~CREATING_CONTROLS;
501 protected bool IsLiteralContent()
503 if (HasControls () && Controls.Count == 1 && (Controls [0] is LiteralControl))
509 public virtual Control FindControl (string id)
\r
511 return FindControl (id, 0);
\r
514 Control LookForControlByName (string id)
519 Control result = null;
520 foreach (Control c in Controls) {
521 if (String.Compare (id, c._userId, true) == 0) {
522 if (result != null && result != c) {
523 throw new HttpException ("1 Found more than one control with ID '" + id + "'");
530 if ((c.stateMask & IS_NAMING_CONTAINER) == 0 && c.HasControls ()) {
531 Control child = c.LookForControlByName (id);
533 if (result != null && result != child)
534 throw new HttpException ("2 Found more than one control with ID '" + id + "'");
544 protected virtual Control FindControl (string id, int pathOffset)
\r
546 EnsureChildControls ();
\r
547 Control namingContainer = null;
\r
548 if ((stateMask & IS_NAMING_CONTAINER) == 0) {
549 namingContainer = NamingContainer;
\r
550 if (namingContainer == null)
\r
553 return namingContainer.FindControl (id, pathOffset);
\r
559 int colon = id.IndexOf (':', pathOffset);
\r
561 return LookForControlByName (id.Substring (pathOffset));
\r
563 string idfound = id.Substring (pathOffset, colon - pathOffset);
\r
564 namingContainer = LookForControlByName (idfound);
\r
565 if (namingContainer == null)
\r
568 return namingContainer.FindControl (id, colon + 1);
\r
571 protected virtual void LoadViewState(object savedState)
573 if (savedState != null) {
574 ViewState.LoadViewState (savedState);
575 object o = ViewState ["Visible"];
577 SetMask (VISIBLE, (bool) o);
578 stateMask |= VISIBLE_CHANGED;
583 [MonoTODO("Secure?")]
\r
584 protected string MapPathSecure(string virtualPath)
\r
586 string combined = UrlUtils.Combine (TemplateSourceDirectory, virtualPath);
\r
587 return Context.Request.MapPath (combined);
\r
590 protected virtual bool OnBubbleEvent(object source, EventArgs args) //DIT
\r
594 protected virtual void OnDataBinding(EventArgs e) //DIT
\r
596 if (_events != null)
\r
598 EventHandler eh = (EventHandler)(_events[DataBindingEvent]);
\r
599 if (eh != null) eh(this, e);
\r
602 protected virtual void OnInit(EventArgs e) //DIT
\r
604 if (_events != null)
\r
606 EventHandler eh = (EventHandler)(_events[InitEvent]);
\r
607 if (eh != null) eh(this, e);
\r
610 protected virtual void OnLoad(EventArgs e) //DIT
\r
612 if (_events != null)
\r
614 EventHandler eh = (EventHandler)(_events[LoadEvent]);
\r
615 if (eh != null) eh(this, e);
\r
618 protected virtual void OnPreRender(EventArgs e) //DIT
\r
620 if (_events != null)
\r
622 EventHandler eh = (EventHandler)(_events[PreRenderEvent]);
\r
623 if (eh != null) eh(this, e);
\r
626 protected virtual void OnUnload(EventArgs e) //DIT
\r
628 if (_events != null)
\r
630 EventHandler eh = (EventHandler)(_events[UnloadEvent]);
\r
631 if (eh != null) eh(this, e);
\r
635 protected void RaiseBubbleEvent(object source, EventArgs args)
\r
637 Control c = Parent;
\r
638 while (c != null) {
\r
639 if (c.OnBubbleEvent (source, args))
\r
645 protected virtual void Render(HtmlTextWriter writer) //DIT
\r
647 RenderChildren(writer);
\r
650 protected virtual void RenderChildren (HtmlTextWriter writer) //DIT
652 if (_renderMethodDelegate != null) {
653 _renderMethodDelegate (writer, this);
654 } else if (HasControls ()) {
655 int len = Controls.Count;
656 for (int i = 0; i < len; i++) {
657 Control c = Controls [i];
658 c.RenderControl (writer);
663 protected virtual object SaveViewState ()
665 if ((stateMask & VISIBLE_CHANGED) != 0) {
666 ViewState ["Visible"] = (stateMask & VISIBLE) != 0;
667 } else if (_viewState == null) {
671 return _viewState.SaveViewState ();
674 protected virtual void TrackViewState()
\r
676 if (_viewState != null)
\r
677 _viewState.TrackViewState ();
\r
679 stateMask |= TRACK_VIEWSTATE;
682 public virtual void Dispose()
\r
684 if (_events != null)
\r
686 EventHandler eh = (EventHandler) _events [DisposedEvent];
\r
688 eh(this, EventArgs.Empty);
\r
692 [WebCategory ("FIXME")]
693 [WebSysDescription ("Raised when the contols databound properties are evaluated.")]
\r
694 public event EventHandler DataBinding //DIT
\r
698 Events.AddHandler(DataBindingEvent, value);
\r
702 Events.RemoveHandler(DataBindingEvent, value);
\r
706 [WebSysDescription ("Raised when the contol is disposed.")]
\r
707 public event EventHandler Disposed //DIT
\r
711 Events.AddHandler(DisposedEvent, value);
\r
715 Events.RemoveHandler(DisposedEvent, value);
\r
719 [WebSysDescription ("Raised when the page containing the control is initialized.")]
\r
720 public event EventHandler Init //DIT
\r
724 Events.AddHandler(InitEvent, value);
\r
728 Events.RemoveHandler(InitEvent, value);
\r
732 [WebSysDescription ("Raised after the page containing the control has been loaded.")]
\r
733 public event EventHandler Load //DIT
\r
737 Events.AddHandler(LoadEvent, value);
\r
741 Events.RemoveHandler(LoadEvent, value);
\r
745 [WebSysDescription ("Raised before the page containing the control is rendered.")]
\r
746 public event EventHandler PreRender //DIT
\r
750 Events.AddHandler(PreRenderEvent, value);
\r
754 Events.RemoveHandler(PreRenderEvent, value);
\r
758 [WebSysDescription ("Raised when the page containing the control is unloaded.")]
\r
759 public event EventHandler Unload //DIT
\r
763 Events.AddHandler(UnloadEvent, value);
\r
767 Events.RemoveHandler(UnloadEvent, value);
\r
771 public virtual void DataBind() //DIT
\r
774 bool foundDataItem = false;
776 if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
777 object o = DataBinder.GetDataItem (this, out foundDataItem);
779 Page.PushDataItemContext (o);
785 OnDataBinding (EventArgs.Empty);
791 Page.PopDataItemContext ();
800 void DataBindChildren ()
805 int len = Controls.Count;
806 for (int i = 0; i < len; i++) {
807 Control c = Controls [i];
813 public virtual bool HasControls ()
815 return (_controls != null && _controls.Count > 0);
818 public void RenderControl(HtmlTextWriter writer)
820 if ((stateMask & VISIBLE) != 0)
824 public string ResolveUrl(string relativeUrl)
826 if (relativeUrl == null)
827 throw new ArgumentNullException ("relativeUrl");
829 if (relativeUrl == "")
832 if (relativeUrl [0] == '#')
835 string ts = TemplateSourceDirectory;
836 if (ts == "" || !UrlUtils.IsRelativeUrl (relativeUrl))
839 HttpResponse resp = Context.Response;
840 return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, relativeUrl));
843 internal bool HasRenderMethodDelegate () {
844 return _renderMethodDelegate != null;
847 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
848 public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT
\r
850 _renderMethodDelegate = renderMethod;
\r
853 internal void LoadRecursive()
\r
855 OnLoad (EventArgs.Empty);
\r
856 if (HasControls ()) {
\r
857 int len = Controls.Count;
858 for (int i=0;i<len;i++)
860 Control c = Controls[i];
\r
861 c.LoadRecursive ();
\r
867 internal void UnloadRecursive(Boolean dispose)
\r
869 if (HasControls ()) {
\r
870 int len = Controls.Count;
871 for (int i=0;i<len;i++)
873 Control c = Controls[i];
\r
874 c.UnloadRecursive (dispose);
\r
878 OnUnload (EventArgs.Empty);
\r
883 internal void PreRenderRecursiveInternal()
885 if ((stateMask & VISIBLE) != 0) {
886 EnsureChildControls ();
887 OnPreRender (EventArgs.Empty);
891 int len = Controls.Count;
892 for (int i=0;i<len;i++)
894 Control c = Controls[i];
895 c.PreRenderRecursiveInternal ();
898 stateMask |= PRERENDERED;
901 internal void InitRecursive(Control namingContainer)
\r
903 if (HasControls ()) {
\r
904 if ((stateMask & IS_NAMING_CONTAINER) != 0)
905 namingContainer = this;
\r
907 if (namingContainer != null &&
\r
908 namingContainer._userId == null &&
\r
909 namingContainer.AutoID)
\r
910 namingContainer._userId = namingContainer.GetDefaultName () + "b";
\r
912 int len = Controls.Count;
913 for (int i=0;i<len;i++)
915 Control c = Controls[i];
\r
917 c._namingContainer = namingContainer;
\r
918 if (namingContainer != null && c._userId == null && c.AutoID)
\r
919 c._userId = namingContainer.GetDefaultName () + "c";
\r
920 c.InitRecursive (namingContainer);
\r
924 stateMask |= INITING;
925 OnInit (EventArgs.Empty);
\r
928 stateMask &= ~INITING;
931 internal object SaveViewStateRecursive ()
933 if (!EnableViewState)
936 ArrayList controlList = null;
937 ArrayList controlStates = null;
942 int len = Controls.Count;
943 for (int i=0;i<len;i++)
945 Control ctrl = Controls[i];
946 object ctrlState = ctrl.SaveViewStateRecursive ();
948 if (ctrlState == null)
951 if (controlList == null)
\r
953 controlList = new ArrayList ();
954 controlStates = new ArrayList ();
957 controlList.Add (idx);
958 controlStates.Add (ctrlState);
962 object thisState = SaveViewState ();
963 if (thisState == null && controlList == null && controlStates == null)
966 return new Triplet (thisState, controlList, controlStates);
969 internal void LoadViewStateRecursive (object savedState)
971 if (!EnableViewState || savedState == null)
974 Triplet savedInfo = (Triplet) savedState;
975 LoadViewState (savedInfo.First);
977 ArrayList controlList = savedInfo.Second as ArrayList;
978 if (controlList == null)
980 ArrayList controlStates = savedInfo.Third as ArrayList;
981 int nControls = controlList.Count;
982 for (int i = 0; i < nControls; i++) {
983 int k = (int) controlList [i];
984 if (k < Controls.Count && controlStates != null) {
985 Control c = Controls [k];
986 c.LoadViewStateRecursive (controlStates [i]);
988 if (pendingVS == null)
989 pendingVS = new Hashtable ();
991 pendingVS [k] = controlStates [i];
995 stateMask |= VIEWSTATE_LOADED;
998 void IParserAccessor.AddParsedSubObject(object obj)
\r
1000 AddParsedSubObject(obj);
\r
1003 DataBindingCollection IDataBindingsAccessor.DataBindings
\r
1007 if(dataBindings == null)
\r
1008 dataBindings = new DataBindingCollection();
\r
1009 return dataBindings;
\r
1013 bool IDataBindingsAccessor.HasDataBindings
\r
1017 return (dataBindings!=null && dataBindings.Count>0);
\r
1021 internal bool AutoID
1023 get { return (stateMask & AUTOID) != 0; }
1025 if (value == false && (stateMask & IS_NAMING_CONTAINER) != 0)
1028 SetMask (AUTOID, value);
1032 internal void PreventAutoID()
\r
1037 protected internal virtual void RemovedControl (Control control)
\r
1039 control.UnloadRecursive (false);
\r
1040 control._parent = null;
\r
1041 control._page = null;
\r
1042 control._namingContainer = null;
\r
1046 protected string GetWebResourceUrl (string resourceName)
1048 return Page.ClientScript.GetWebResourceUrl (GetType(), resourceName);
1051 string IUrlResolutionService.ResolveClientUrl (string url)
1053 throw new NotImplementedException ();
1056 ControlBuilder IControlBuilderAccessor.ControlBuilder {
1057 get {throw new NotImplementedException (); }
1060 IDictionary IControlDesignerAccessor.GetDesignModeState ()
1062 throw new NotImplementedException ();
1065 void IControlDesignerAccessor.SetDesignModeState (IDictionary designData)
1067 throw new NotImplementedException ();
1070 void IControlDesignerAccessor.SetOwnerControl (Control control)
1072 throw new NotImplementedException ();
1075 IDictionary IControlDesignerAccessor.UserData {
1076 get { throw new NotImplementedException (); }
1079 ExpressionBindingCollection expressionBindings;
1081 ExpressionBindingCollection IExpressionsAccessor.Expressions {
1083 if (expressionBindings == null)
1084 expressionBindings = new ExpressionBindingCollection ();
\r
1085 return expressionBindings;
\r
1089 bool IExpressionsAccessor.HasExpressions {
1091 return (expressionBindings != null && expressionBindings.Count > 0);
\r
1096 public virtual void Focus()
\r
1098 throw new NotImplementedException();
\r
1101 protected internal virtual void LoadControlState (object state)
1105 protected internal virtual object SaveControlState ()