private RenderMethod _renderMethodDelegate = null;\r
private bool autoID = true;\r
private bool creatingControls = false;\r
+ private bool bindingContainer = true;\r
+ private bool autoEventWireup = true;\r
\r
private DataBindingCollection dataBindings = null;\r
\r
{\r
get {\r
Control container = NamingContainer;\r
- if (_isNamingContainer)\r
+ if (!container.bindingContainer)\r
container = container.BindingContainer;\r
return container;\r
}\r
_site = value;\r
}\r
}\r
- public virtual string TemplateSourceDirectory\r
- {\r
- get\r
- {\r
- return Context.Request.ApplicationPath; //TODO: Dont think this is right.\r
- }\r
+\r
+ public virtual string TemplateSourceDirectory {\r
+ get { return (_parent == null) ? String.Empty : _parent.TemplateSourceDirectory; }\r
}\r
\r
[MonoTODO]\r
return _viewState;\r
}\r
}\r
+\r
protected virtual bool ViewStateIgnoresCase\r
{\r
get {\r
}\r
}\r
\r
+ internal bool AutoEventWireup {\r
+ get { return autoEventWireup; }\r
+ set { autoEventWireup = value; }\r
+ }\r
+\r
+ internal void SetBindingContainer (bool isBC)\r
+ {\r
+ bindingContainer = isBC;\r
+ }\r
+ \r
private int defaultNumberID;\r
protected internal virtual void AddedControl (Control control, int index)\r
{\r
control._namingContainer = namingContainer;\r
\r
if (control.AutoID == true && control.ID == null)\r
- control.ID = "_ctrl_" + defaultNumberID++;\r
+ control.ID = ID + "_ctrl_" + defaultNumberID++;\r
}\r
\r
protected virtual void AddParsedSubObject(object obj) //DIT\r
ViewState.LoadViewState (savedState);\r
}\r
\r
- [MonoTODO]\r
+ [MonoTODO("Secure?")]\r
protected string MapPathSecure(string virtualPath)\r
{\r
- //TODO: Need to read up on security+web.\r
- //Return the same path. So AdRotator can read its config file.\r
- return virtualPath;\r
+ string combined = UrlUtils.Combine (TemplateSourceDirectory, virtualPath);\r
+ return Context.Request.MapPath (combined);\r
}\r
+\r
protected virtual bool OnBubbleEvent(object source, EventArgs args) //DIT\r
{\r
return false;\r
\r
protected void PreRenderRecursiveInternal()\r
{\r
- OnPreRender(EventArgs.Empty);\r
- if (_controls != null) foreach (Control c in _controls) c.PreRenderRecursiveInternal();\r
+ if (_visible) {\r
+ EnsureChildControls ();\r
+ OnPreRender (EventArgs.Empty);\r
+ if (_controls == null)\r
+ return;\r
+\r
+ foreach (Control c in _controls)\r
+ c.PreRenderRecursiveInternal ();\r
+ }\r
}\r
\r
protected void InitRecursive(Control namingContainer)\r
controlList = new ArrayList ();\r
controlStates = new ArrayList ();\r
}\r
- controlList.Add (ctrl);\r
+ controlList.Add (ctrl.ID);\r
controlStates.Add (ctrl.SaveViewStateRecursive ());\r
}\r
\r
ArrayList controlStates = savedInfo.Third as ArrayList;\r
int nControls = controlList.Count;\r
for (int i = 0; i < nControls; i++) {\r
- if (controlStates != null)\r
- Controls [i].LoadViewStateRecursive (controlStates [i]);\r
+ Control c = FindControl ((string) controlList [i]);\r
+ if (c != null && controlStates != null)\r
+ c.LoadViewStateRecursive (controlStates [i]);\r
}\r
}\r
\r