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)
\r
519 foreach (Control c in Controls) {
520 if (String.Compare (id, c._userId, true) == 0)
\r
523 if ((c.stateMask & IS_NAMING_CONTAINER) == 0 && c.HasControls ()) {
\r
524 Control child = c.LookForControlByName (id);
\r
533 protected virtual Control FindControl (string id, int pathOffset)
\r
535 EnsureChildControls ();
\r
536 Control namingContainer = null;
\r
537 if ((stateMask & IS_NAMING_CONTAINER) == 0) {
538 namingContainer = NamingContainer;
\r
539 if (namingContainer == null)
\r
542 return namingContainer.FindControl (id, pathOffset);
\r
548 int colon = id.IndexOf (':', pathOffset);
\r
550 return LookForControlByName (id.Substring (pathOffset));
\r
552 string idfound = id.Substring (pathOffset, colon - pathOffset);
\r
553 namingContainer = LookForControlByName (idfound);
\r
554 if (namingContainer == null)
\r
557 return namingContainer.FindControl (id, colon + 1);
\r
560 protected virtual void LoadViewState(object savedState)
562 if (savedState != null) {
563 ViewState.LoadViewState (savedState);
564 object o = ViewState ["Visible"];
566 SetMask (VISIBLE, (bool) o);
567 stateMask |= VISIBLE_CHANGED;
572 [MonoTODO("Secure?")]
\r
573 protected string MapPathSecure(string virtualPath)
\r
575 string combined = UrlUtils.Combine (TemplateSourceDirectory, virtualPath);
\r
576 return Context.Request.MapPath (combined);
\r
579 protected virtual bool OnBubbleEvent(object source, EventArgs args) //DIT
\r
583 protected virtual void OnDataBinding(EventArgs e) //DIT
\r
585 if (_events != null)
\r
587 EventHandler eh = (EventHandler)(_events[DataBindingEvent]);
\r
588 if (eh != null) eh(this, e);
\r
591 protected virtual void OnInit(EventArgs e) //DIT
\r
593 if (_events != null)
\r
595 EventHandler eh = (EventHandler)(_events[InitEvent]);
\r
596 if (eh != null) eh(this, e);
\r
599 protected virtual void OnLoad(EventArgs e) //DIT
\r
601 if (_events != null)
\r
603 EventHandler eh = (EventHandler)(_events[LoadEvent]);
\r
604 if (eh != null) eh(this, e);
\r
607 protected virtual void OnPreRender(EventArgs e) //DIT
\r
609 if (_events != null)
\r
611 EventHandler eh = (EventHandler)(_events[PreRenderEvent]);
\r
612 if (eh != null) eh(this, e);
\r
615 protected virtual void OnUnload(EventArgs e) //DIT
\r
617 if (_events != null)
\r
619 EventHandler eh = (EventHandler)(_events[UnloadEvent]);
\r
620 if (eh != null) eh(this, e);
\r
624 protected void RaiseBubbleEvent(object source, EventArgs args)
\r
626 Control c = Parent;
\r
627 while (c != null) {
\r
628 if (c.OnBubbleEvent (source, args))
\r
634 protected virtual void Render(HtmlTextWriter writer) //DIT
\r
636 RenderChildren(writer);
\r
639 protected virtual void RenderChildren (HtmlTextWriter writer) //DIT
641 if (_renderMethodDelegate != null) {
642 _renderMethodDelegate (writer, this);
643 } else if (HasControls ()) {
644 int len = Controls.Count;
645 for (int i = 0; i < len; i++) {
646 Control c = Controls [i];
647 c.RenderControl (writer);
652 protected virtual object SaveViewState ()
654 if ((stateMask & VISIBLE_CHANGED) != 0) {
655 ViewState ["Visible"] = Visible;
656 } else if (_viewState == null) {
660 return _viewState.SaveViewState ();
663 protected virtual void TrackViewState()
\r
665 if (_viewState != null)
\r
666 _viewState.TrackViewState ();
\r
668 stateMask |= TRACK_VIEWSTATE;
671 public virtual void Dispose()
\r
673 if (_events != null)
\r
675 EventHandler eh = (EventHandler) _events [DisposedEvent];
\r
677 eh(this, EventArgs.Empty);
\r
681 [WebCategory ("FIXME")]
682 [WebSysDescription ("Raised when the contols databound properties are evaluated.")]
\r
683 public event EventHandler DataBinding //DIT
\r
687 Events.AddHandler(DataBindingEvent, value);
\r
691 Events.RemoveHandler(DataBindingEvent, value);
\r
695 [WebSysDescription ("Raised when the contol is disposed.")]
\r
696 public event EventHandler Disposed //DIT
\r
700 Events.AddHandler(DisposedEvent, value);
\r
704 Events.RemoveHandler(DisposedEvent, value);
\r
708 [WebSysDescription ("Raised when the page containing the control is initialized.")]
\r
709 public event EventHandler Init //DIT
\r
713 Events.AddHandler(InitEvent, value);
\r
717 Events.RemoveHandler(InitEvent, value);
\r
721 [WebSysDescription ("Raised after the page containing the control has been loaded.")]
\r
722 public event EventHandler Load //DIT
\r
726 Events.AddHandler(LoadEvent, value);
\r
730 Events.RemoveHandler(LoadEvent, value);
\r
734 [WebSysDescription ("Raised before the page containing the control is rendered.")]
\r
735 public event EventHandler PreRender //DIT
\r
739 Events.AddHandler(PreRenderEvent, value);
\r
743 Events.RemoveHandler(PreRenderEvent, value);
\r
747 [WebSysDescription ("Raised when the page containing the control is unloaded.")]
\r
748 public event EventHandler Unload //DIT
\r
752 Events.AddHandler(UnloadEvent, value);
\r
756 Events.RemoveHandler(UnloadEvent, value);
\r
760 public virtual void DataBind() //DIT
\r
763 bool foundDataItem = false;
765 if ((stateMask & IS_NAMING_CONTAINER) != 0 && Page != null) {
766 object o = DataBinder.GetDataItem (this, out foundDataItem);
768 Page.PushDataItemContext (o);
774 OnDataBinding (EventArgs.Empty);
780 Page.PopDataItemContext ();
789 void DataBindChildren ()
794 int len = Controls.Count;
795 for (int i = 0; i < len; i++) {
796 Control c = Controls [i];
802 public virtual bool HasControls ()
804 return (_controls != null && _controls.Count > 0);
807 public void RenderControl(HtmlTextWriter writer)
809 if ((stateMask & VISIBLE) != 0)
813 public string ResolveUrl(string relativeUrl)
815 if (relativeUrl == null)
816 throw new ArgumentNullException ("relativeUrl");
818 if (relativeUrl == "")
821 if (relativeUrl [0] == '#')
824 string ts = TemplateSourceDirectory;
825 if (ts == "" || !UrlUtils.IsRelativeUrl (relativeUrl))
828 if (relativeUrl.IndexOf ('/') == -1 && relativeUrl [0] != '.' && relativeUrl != "..")
831 HttpResponse resp = Context.Response;
832 return resp.ApplyAppPathModifier (UrlUtils.Combine (ts, relativeUrl));
835 [EditorBrowsable (EditorBrowsableState.Advanced)]
\r
836 public void SetRenderMethodDelegate(RenderMethod renderMethod) //DIT
\r
838 _renderMethodDelegate = renderMethod;
\r
841 internal void LoadRecursive()
\r
843 OnLoad (EventArgs.Empty);
\r
844 if (HasControls ()) {
\r
845 int len = Controls.Count;
846 for (int i=0;i<len;i++)
848 Control c = Controls[i];
\r
849 c.LoadRecursive ();
\r
855 internal void UnloadRecursive(Boolean dispose)
\r
857 if (HasControls ()) {
\r
858 int len = Controls.Count;
859 for (int i=0;i<len;i++)
861 Control c = Controls[i];
\r
862 c.UnloadRecursive (dispose);
\r
866 OnUnload (EventArgs.Empty);
\r
871 internal void PreRenderRecursiveInternal()
873 if ((stateMask & VISIBLE) != 0) {
874 EnsureChildControls ();
875 OnPreRender (EventArgs.Empty);
879 int len = Controls.Count;
880 for (int i=0;i<len;i++)
882 Control c = Controls[i];
883 c.PreRenderRecursiveInternal ();
886 stateMask |= PRERENDERED;
889 internal void InitRecursive(Control namingContainer)
\r
891 if (HasControls ()) {
\r
892 if ((stateMask & IS_NAMING_CONTAINER) != 0)
893 namingContainer = this;
\r
895 if (namingContainer != null &&
\r
896 namingContainer._userId == null &&
\r
897 namingContainer.AutoID)
\r
898 namingContainer._userId = namingContainer.GetDefaultName () + "b";
\r
900 int len = Controls.Count;
901 for (int i=0;i<len;i++)
903 Control c = Controls[i];
\r
905 c._namingContainer = namingContainer;
\r
906 if (namingContainer != null && c._userId == null && c.AutoID)
\r
907 c._userId = namingContainer.GetDefaultName () + "c";
\r
908 c.InitRecursive (namingContainer);
\r
912 stateMask |= INITING;
913 OnInit (EventArgs.Empty);
\r
916 stateMask &= ~INITING;
919 internal object SaveViewStateRecursive ()
921 if (!EnableViewState)
924 ArrayList controlList = null;
925 ArrayList controlStates = null;
930 int len = Controls.Count;
931 for (int i=0;i<len;i++)
933 Control ctrl = Controls[i];
934 object ctrlState = ctrl.SaveViewStateRecursive ();
936 if (ctrlState == null)
939 if (controlList == null)
\r
941 controlList = new ArrayList ();
942 controlStates = new ArrayList ();
945 controlList.Add (idx);
946 controlStates.Add (ctrlState);
950 object thisState = SaveViewState ();
951 if (thisState == null && controlList == null && controlStates == null)
954 return new Triplet (thisState, controlList, controlStates);
957 internal void LoadViewStateRecursive (object savedState)
959 if (!EnableViewState || savedState == null)
962 Triplet savedInfo = (Triplet) savedState;
963 LoadViewState (savedInfo.First);
965 ArrayList controlList = savedInfo.Second as ArrayList;
966 if (controlList == null)
968 ArrayList controlStates = savedInfo.Third as ArrayList;
969 int nControls = controlList.Count;
970 for (int i = 0; i < nControls; i++) {
971 int k = (int) controlList [i];
972 if (k < Controls.Count && controlStates != null) {
973 Control c = Controls [k];
974 c.LoadViewStateRecursive (controlStates [i]);
976 if (pendingVS == null)
977 pendingVS = new Hashtable ();
979 pendingVS [k] = controlStates [i];
983 stateMask |= VIEWSTATE_LOADED;
986 void IParserAccessor.AddParsedSubObject(object obj)
\r
988 AddParsedSubObject(obj);
\r
991 DataBindingCollection IDataBindingsAccessor.DataBindings
\r
995 if(dataBindings == null)
\r
996 dataBindings = new DataBindingCollection();
\r
997 return dataBindings;
\r
1001 bool IDataBindingsAccessor.HasDataBindings
\r
1005 return (dataBindings!=null && dataBindings.Count>0);
\r
1009 internal bool AutoID
1011 get { return (stateMask & AUTOID) != 0; }
1013 if (value == false && (stateMask & IS_NAMING_CONTAINER) != 0)
1016 SetMask (AUTOID, value);
1020 internal void PreventAutoID()
\r
1025 protected internal virtual void RemovedControl (Control control)
\r
1027 control.UnloadRecursive (false);
\r
1028 control._parent = null;
\r
1029 control._page = null;
\r
1030 control._namingContainer = null;
\r
1034 protected string GetWebResourceUrl (string resourceName)
1036 return Page.GetWebResourceUrl (GetType(), resourceName);
1039 string IUrlResolutionService.ResolveClientUrl (string url)
1041 throw new NotImplementedException ();
1044 ControlBuilder IControlBuilderAccessor.ControlBuilder {
1045 get {throw new NotImplementedException (); }
1048 IDictionary IControlDesignerAccessor.GetDesignModeState ()
1050 throw new NotImplementedException ();
1053 void IControlDesignerAccessor.SetDesignModeState (IDictionary designData)
1055 throw new NotImplementedException ();
1058 void IControlDesignerAccessor.SetOwnerControl (Control control)
1060 throw new NotImplementedException ();
1063 IDictionary IControlDesignerAccessor.UserData {
1064 get { throw new NotImplementedException (); }
1067 ExpressionBindingCollection expressionBindings;
1068 ExpressionBindingCollection IExpressionsAccessor.Expressions {
1070 if (expressionBindings == null)
1071 expressionBindings = new ExpressionBindingCollection ();
\r
1072 return expressionBindings;
\r
1076 bool IExpressionsAccessor.HasExpressions {
1078 return (expressionBindings != null && expressionBindings.Count > 0);
\r
1083 public virtual void Focus()
\r
1085 throw new NotImplementedException();
\r