2 // System.Web.UI.Page.cs
5 // Duncan Mak (duncan@ximian.com)
6 // Gonzalo Paniagua (gonzalo@ximian.com)
7 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
9 // (C) 2002,2003 Ximian, Inc. (http://www.ximian.com)
10 // (c) 2003 Novell, Inc. (http://www.novell.com)
14 using System.Collections;
15 using System.Collections.Specialized;
16 using System.ComponentModel;
17 using System.ComponentModel.Design;
18 using System.ComponentModel.Design.Serialization;
19 using System.Globalization;
21 using System.Security.Principal;
23 using System.Threading;
25 using System.Web.Caching;
26 using System.Web.SessionState;
27 using System.Web.Util;
29 namespace System.Web.UI
32 // TODO FIXME missing the IRootDesigner Attribute
33 [DefaultEvent ("Load"), DesignerCategory ("ASPXCodeBehind")]
35 [Designer ("System.Web.UI.Design.ControlDesigner, " + Consts.AssemblySystem_Design, typeof (IDesigner))]
36 [RootDesignerSerializer ("Microsoft.VSDesigner.WebForms.RootCodeDomSerializer, " + Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.Serialization.CodeDomSerializer, " + Consts.AssemblySystem_Design, true)]
37 public class Page : TemplateControl, IHttpHandler
39 private bool _viewState = true;
40 private bool _viewStateMac;
41 private string _errorPage;
42 private bool _isValid;
43 private bool _smartNavigation;
44 private int _transactionMode;
45 private HttpContext _context;
46 private ValidatorCollection _validators;
47 private bool renderingForm;
48 private object _savedViewState;
49 private ArrayList _requiresPostBack;
50 private ArrayList _requiresPostBackCopy;
51 private ArrayList requiresPostDataChanged;
52 private IPostBackEventHandler requiresRaiseEvent;
53 private NameValueCollection secondPostData;
54 private bool requiresPostBackScript;
55 private bool postBackScriptRendered;
56 private Hashtable registeredArrayDeclares;
57 Hashtable clientScriptBlocks;
58 Hashtable startupScriptBlocks;
59 Hashtable hiddenFields;
60 internal Hashtable submitStatements;
63 [EditorBrowsable (EditorBrowsableState.Never)]
64 protected const string postEventArgumentID = "__EVENTARGUMENT";
65 [EditorBrowsable (EditorBrowsableState.Never)]
66 protected const string postEventSourceID = "__EVENTTARGET";
78 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
80 public HttpApplicationState Application
82 get { return _context.Application; }
85 [EditorBrowsable (EditorBrowsableState.Never)]
86 protected bool AspCompatMode
88 set { throw new NotImplementedException (); }
91 [EditorBrowsable (EditorBrowsableState.Never)]
94 set { Response.BufferOutput = value; }
97 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
101 get { return _context.Cache; }
105 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
106 [Browsable (false), DefaultValue ("")]
107 [WebSysDescription ("Value do override the automatic browser detection and force the page to use the specified browser.")]
108 public string ClientTarget
110 get { throw new NotImplementedException (); }
111 set { throw new NotImplementedException (); }
114 [EditorBrowsable (EditorBrowsableState.Never)]
115 protected int CodePage
117 set { Response.ContentEncoding = Encoding.GetEncoding (value); }
120 [EditorBrowsable (EditorBrowsableState.Never)]
121 protected string ContentType
123 set { Response.ContentType = value; }
126 protected override HttpContext Context
128 get { return _context; }
131 [EditorBrowsable (EditorBrowsableState.Never)]
132 protected string Culture
134 set { Thread.CurrentThread.CurrentCulture = new CultureInfo (value); }
138 public override bool EnableViewState
140 get { return _viewState; }
141 set { _viewState = value; }
144 [EditorBrowsable (EditorBrowsableState.Never)]
145 protected bool EnableViewStateMac
147 get { return _viewStateMac; }
148 set { _viewStateMac = value; }
151 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
152 [Browsable (false), DefaultValue ("")]
153 [WebSysDescription ("The URL of a page used for error redirection.")]
154 public string ErrorPage
156 get { return _errorPage; }
159 if (_context != null)
160 _context.ErrorPage = value;
164 [EditorBrowsable (EditorBrowsableState.Never)]
165 protected ArrayList FileDependencies
168 if (Response != null)
169 Response.AddFileDependencies (value);
174 public override string ID
176 get { return base.ID; }
177 set { base.ID = value; }
180 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
182 public bool IsPostBack
185 return (0 == String.Compare (Request.HttpMethod, "POST", true));
189 [EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
190 public bool IsReusable {
191 get { return false; }
194 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
198 get { return _isValid; }
201 [EditorBrowsable (EditorBrowsableState.Never)]
203 set { Thread.CurrentThread.CurrentCulture = new CultureInfo (value); }
206 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
208 public HttpRequest Request
210 get { return _context.Request; }
213 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
215 public HttpResponse Response
217 get { return _context.Response; }
220 [EditorBrowsable (EditorBrowsableState.Never)]
221 protected string ResponseEncoding
223 set { Response.ContentEncoding = Encoding.GetEncoding (value); }
226 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
228 public HttpServerUtility Server
231 return Context.Server;
235 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
237 public virtual HttpSessionState Session
239 get { return _context.Session; }
243 public bool SmartNavigation
245 get { return _smartNavigation; }
246 set { _smartNavigation = value; }
249 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
251 public TraceContext Trace
253 get { return Context.Trace; }
256 [EditorBrowsable (EditorBrowsableState.Never)]
257 protected bool TraceEnabled
259 set { Trace.IsEnabled = value; }
262 [EditorBrowsable (EditorBrowsableState.Never)]
263 protected TraceMode TraceModeValue
265 set { Trace.TraceMode = value; }
268 [EditorBrowsable (EditorBrowsableState.Never)]
269 protected int TransactionMode
271 set { _transactionMode = value; }
274 [EditorBrowsable (EditorBrowsableState.Never)]
275 protected string UICulture
277 set { Thread.CurrentThread.CurrentUICulture = new CultureInfo (value); }
280 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
282 public IPrincipal User
284 get { return _context.User; }
287 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
289 public ValidatorCollection Validators
292 if (_validators == null)
293 _validators = new ValidatorCollection ();
299 public override bool Visible
301 get { return base.Visible; }
302 set { base.Visible = value; }
310 [EditorBrowsable (EditorBrowsableState.Never)]
311 protected IAsyncResult AspCompatBeginProcessRequest (HttpContext context,
315 throw new NotImplementedException ();
319 [EditorBrowsable (EditorBrowsableState.Never)]
320 protected void AspCompatEndProcessRequest (IAsyncResult result)
322 throw new NotImplementedException ();
325 [EditorBrowsable (EditorBrowsableState.Advanced)]
326 protected virtual HtmlTextWriter CreateHtmlTextWriter (TextWriter tw)
328 return new HtmlTextWriter (tw);
332 [EditorBrowsable (EditorBrowsableState.Never)]
333 public void DesignerInitialize ()
335 throw new NotImplementedException ();
338 [EditorBrowsable (EditorBrowsableState.Advanced)]
339 protected virtual NameValueCollection DeterminePostBackMode ()
341 if (_context == null)
344 HttpRequest req = _context.Request;
348 NameValueCollection coll = null;
352 coll = req.QueryString;
355 if (coll == null || coll ["__VIEWSTATE"] == null)
361 [EditorBrowsable (EditorBrowsableState.Advanced)]
362 public string GetPostBackClientEvent (Control control, string argument)
364 return GetPostBackEventReference (control, argument);
367 [EditorBrowsable (EditorBrowsableState.Advanced)]
368 public string GetPostBackClientHyperlink (Control control, string argument)
370 return "javascript:" + GetPostBackEventReference (control, argument);
373 [EditorBrowsable (EditorBrowsableState.Advanced)]
374 public string GetPostBackEventReference (Control control)
376 return GetPostBackEventReference (control, "");
379 [EditorBrowsable (EditorBrowsableState.Advanced)]
380 public string GetPostBackEventReference (Control control, string argument)
382 RequiresPostBackScript ();
383 return String.Format ("__doPostBack('{0}','{1}')", control.UniqueID, argument);
386 internal void RequiresPostBackScript ()
388 requiresPostBackScript = true;
391 [EditorBrowsable (EditorBrowsableState.Never)]
392 public virtual int GetTypeHashCode ()
398 [EditorBrowsable (EditorBrowsableState.Never)]
399 protected virtual void InitOutputCache (int duration,
402 OutputCacheLocation location,
405 HttpCachePolicy cache = _context.Response.Cache;
408 case OutputCacheLocation.Any:
409 cache.SetCacheability (HttpCacheability.Public);
410 cache.SetMaxAge (new TimeSpan (0, 0, duration));
411 cache.SetLastModified (_context.Timestamp);
412 goto case OutputCacheLocation.Server;
413 case OutputCacheLocation.Client:
414 cache.SetCacheability (HttpCacheability.Private);
415 cache.SetMaxAge (new TimeSpan (0, 0, duration));
416 cache.SetLastModified (_context.Timestamp);
418 case OutputCacheLocation.Downstream:
419 cache.SetCacheability (HttpCacheability.Public);
420 cache.SetMaxAge (new TimeSpan (0, 0, duration));
421 cache.SetLastModified (_context.Timestamp);
423 case OutputCacheLocation.Server:
424 if (varyByCustom != null)
425 cache.SetVaryByCustom (varyByCustom);
427 if (varyByParam.Length > 0) {
428 string[] prms = varyByParam.Split (';');
429 foreach (string p in prms)
430 cache.VaryByParams [p.Trim ()] = true;
431 cache.VaryByParams.IgnoreParams = false;
433 cache.VaryByParams.IgnoreParams = true;
436 if (varyByHeader != null) {
437 string[] hdrs = varyByHeader.Split (';');
438 foreach (string h in hdrs)
439 cache.VaryByHeaders [h.Trim ()] = true;
441 _context.Response.CacheResponse (_context.Request);
443 case OutputCacheLocation.None:
446 cache.SetExpires (_context.Timestamp.AddSeconds (duration));
449 [EditorBrowsable (EditorBrowsableState.Advanced)]
450 public bool IsClientScriptBlockRegistered (string key)
452 if (clientScriptBlocks == null)
455 return clientScriptBlocks.ContainsKey (key);
458 [EditorBrowsable (EditorBrowsableState.Advanced)]
459 public bool IsStartupScriptRegistered (string key)
461 if (startupScriptBlocks == null)
464 return startupScriptBlocks.ContainsKey (key);
467 public string MapPath (string virtualPath)
469 return Request.MapPath (virtualPath);
472 private void RenderPostBackScript (HtmlTextWriter writer, string formUniqueID)
474 writer.WriteLine ("<input type=\"hidden\" name=\"{0}\" value=\"\" />", postEventSourceID);
475 writer.WriteLine ("<input type=\"hidden\" name=\"{0}\" value=\"\" />", postEventArgumentID);
477 writer.WriteLine ("<script language=\"javascript\">");
478 writer.WriteLine ("<!--");
479 writer.WriteLine ("\tfunction __doPostBack(eventTarget, eventArgument) {");
480 writer.WriteLine ("\t\tvar theform = document.getElementById ('{0}');", formUniqueID);
481 writer.WriteLine ("\t\ttheform.{0}.value = eventTarget;", postEventSourceID);
482 writer.WriteLine ("\t\ttheform.{0}.value = eventArgument;", postEventArgumentID);
483 writer.WriteLine ("\t\ttheform.submit();");
484 writer.WriteLine ("\t}");
485 writer.WriteLine ("// -->");
486 writer.WriteLine ("</script>");
489 static void WriteScripts (HtmlTextWriter writer, Hashtable scripts)
494 foreach (string key in scripts.Values)
495 writer.WriteLine (key);
498 void WriteHiddenFields (HtmlTextWriter writer)
500 if (hiddenFields == null)
503 foreach (string key in hiddenFields.Keys) {
504 string value = hiddenFields [key] as string;
505 writer.WriteLine ("\n<input type=\"hidden\" name=\"{0}\" value=\"{1}\" />", key, value);
511 internal void OnFormRender (HtmlTextWriter writer, string formUniqueID)
514 throw new HttpException ("Only 1 HtmlForm is allowed per page.");
516 renderingForm = true;
518 WriteHiddenFields (writer);
519 if (requiresPostBackScript) {
520 RenderPostBackScript (writer, formUniqueID);
521 postBackScriptRendered = true;
524 if (handleViewState) {
525 writer.Write ("<input type=\"hidden\" name=\"__VIEWSTATE\" ");
526 writer.WriteLine ("value=\"{0}\" />", GetViewStateString ());
529 WriteScripts (writer, clientScriptBlocks);
532 internal string GetViewStateString ()
534 StringWriter sr = new StringWriter ();
535 LosFormatter fmt = new LosFormatter ();
536 fmt.Serialize (sr, _savedViewState);
537 return sr.GetStringBuilder ().ToString ();
540 internal void OnFormPostRender (HtmlTextWriter writer, string formUniqueID)
542 if (registeredArrayDeclares != null) {
544 writer.WriteLine("<script language=\"javascript\">");
545 writer.WriteLine("<!--");
546 IDictionaryEnumerator arrayEnum = registeredArrayDeclares.GetEnumerator();
547 while (arrayEnum.MoveNext()) {
548 writer.Write("\tvar ");
549 writer.Write(arrayEnum.Key);
550 writer.Write(" = new Array(");
551 IEnumerator arrayListEnum = ((ArrayList) arrayEnum.Value).GetEnumerator();
553 while (arrayListEnum.MoveNext()) {
558 writer.Write(arrayListEnum.Current);
560 writer.WriteLine(");");
562 writer.WriteLine("// -->");
563 writer.WriteLine("</script>");
567 if (!postBackScriptRendered && requiresPostBackScript)
568 RenderPostBackScript (writer, formUniqueID);
570 WriteHiddenFields (writer);
571 WriteScripts (writer, startupScriptBlocks);
572 renderingForm = false;
573 postBackScriptRendered = false;
576 private void ProcessPostData (NameValueCollection data, bool second)
581 if (_requiresPostBackCopy == null && _requiresPostBack != null)
582 _requiresPostBackCopy = (ArrayList) _requiresPostBack.Clone ();
584 Hashtable used = new Hashtable ();
585 foreach (string id in data.AllKeys){
586 if (id == "__VIEWSTATE" || id == postEventSourceID || id == postEventArgumentID)
590 int dot = real_id.IndexOf ('.');
592 real_id = real_id.Substring (0, dot);
594 if (real_id == null || used.ContainsKey (real_id))
597 used.Add (real_id, real_id);
599 Control ctrl = FindControl (real_id);
601 IPostBackDataHandler pbdh = ctrl as IPostBackDataHandler;
602 IPostBackEventHandler pbeh = ctrl as IPostBackEventHandler;
606 RegisterRequiresRaiseEvent (pbeh);
610 if (pbdh.LoadPostData (real_id, data) == true) {
611 if (requiresPostDataChanged == null)
612 requiresPostDataChanged = new ArrayList ();
613 requiresPostDataChanged.Add (pbdh);
614 if (_requiresPostBackCopy != null)
615 _requiresPostBackCopy.Remove (ctrl.UniqueID);
617 } else if (!second) {
618 if (secondPostData == null)
619 secondPostData = new NameValueCollection ();
620 secondPostData.Add (real_id, data [id]);
624 if (_requiresPostBackCopy != null && _requiresPostBackCopy.Count > 0) {
625 string [] handlers = (string []) _requiresPostBackCopy.ToArray (typeof (string));
626 foreach (string id in handlers) {
627 IPostBackDataHandler pbdh = FindControl (id) as IPostBackDataHandler;
631 _requiresPostBackCopy.Remove (id);
632 if (pbdh.LoadPostData (id, data)) {
633 if (requiresPostDataChanged == null)
634 requiresPostDataChanged = new ArrayList ();
636 requiresPostDataChanged.Add (pbdh);
642 [EditorBrowsable (EditorBrowsableState.Never)]
643 public void ProcessRequest (HttpContext context)
646 WireupAutomaticEvents ();
647 //-- Control execution lifecycle in the docs
649 // Save culture information because it can be modified in FrameworkInitialize()
650 CultureInfo culture = Thread.CurrentThread.CurrentCulture;
651 CultureInfo uiculture = Thread.CurrentThread.CurrentUICulture;
652 FrameworkInitialize ();
653 context.ErrorPage = _errorPage;
656 InternalProcessRequest ();
658 Thread.CurrentThread.CurrentCulture = culture;
659 Thread.CurrentThread.CurrentUICulture = uiculture;
663 void InternalProcessRequest ()
665 InitRecursive (null);
666 renderingForm = false;
668 LoadPageViewState ();
669 ProcessPostData (DeterminePostBackMode (), false);
674 ProcessPostData (secondPostData, true);
675 RaiseChangedEvents ();
676 RaisePostBackEvents ();
678 PreRenderRecursiveInternal ();
680 SavePageViewState ();
682 HtmlTextWriter output = new HtmlTextWriter (_context.Response.Output);
683 RenderControl (output);
684 RenderTrace (output);
686 UnloadRecursive (true);
689 private void RenderTrace (HtmlTextWriter output)
691 if (!Trace.IsEnabled)
693 Trace.Render (output);
696 internal void RaisePostBackEvents ()
698 if (requiresRaiseEvent != null) {
699 RaisePostBackEvent (requiresRaiseEvent, null);
703 NameValueCollection postdata = DeterminePostBackMode ();
704 if (postdata == null)
707 string eventTarget = postdata [postEventSourceID];
708 if (eventTarget == null || eventTarget.Length == 0)
711 IPostBackEventHandler target = FindControl (eventTarget) as IPostBackEventHandler;
715 string eventArgument = postdata [postEventArgumentID];
716 RaisePostBackEvent (target, eventArgument);
719 internal void RaiseChangedEvents ()
721 if (requiresPostDataChanged == null)
724 foreach (IPostBackDataHandler ipdh in requiresPostDataChanged)
725 ipdh.RaisePostDataChangedEvent ();
727 requiresPostDataChanged = null;
730 [EditorBrowsable (EditorBrowsableState.Advanced)]
731 protected virtual void RaisePostBackEvent (IPostBackEventHandler sourceControl, string eventArgument)
733 sourceControl.RaisePostBackEvent (eventArgument);
736 [EditorBrowsable (EditorBrowsableState.Advanced)]
737 public void RegisterArrayDeclaration (string arrayName, string arrayValue)
739 if (registeredArrayDeclares == null)
740 registeredArrayDeclares = new Hashtable();
742 if (!registeredArrayDeclares.ContainsKey (arrayName))
743 registeredArrayDeclares.Add (arrayName, new ArrayList());
745 ((ArrayList) registeredArrayDeclares[arrayName]).Add(arrayValue);
748 [EditorBrowsable (EditorBrowsableState.Advanced)]
749 public virtual void RegisterClientScriptBlock (string key, string script)
751 if (IsClientScriptBlockRegistered (key))
754 if (clientScriptBlocks == null)
755 clientScriptBlocks = new Hashtable ();
757 clientScriptBlocks.Add (key, script);
760 [EditorBrowsable (EditorBrowsableState.Advanced)]
761 public virtual void RegisterHiddenField (string hiddenFieldName, string hiddenFieldInitialValue)
763 if (hiddenFields == null)
764 hiddenFields = new Hashtable ();
766 if (!hiddenFields.ContainsKey (hiddenFieldName))
767 hiddenFields.Add (hiddenFieldName, hiddenFieldInitialValue);
771 public void RegisterClientScriptFile (string a, string b, string c)
773 throw new NotImplementedException ();
777 [EditorBrowsable (EditorBrowsableState.Advanced)]
778 public void RegisterOnSubmitStatement (string key, string script)
780 if (submitStatements == null)
781 submitStatements = new Hashtable ();
783 if (submitStatements.ContainsKey (key))
786 submitStatements.Add (key, script);
789 [EditorBrowsable (EditorBrowsableState.Advanced)]
790 public void RegisterRequiresPostBack (Control control)
792 if (_requiresPostBack == null)
793 _requiresPostBack = new ArrayList ();
795 _requiresPostBack.Add (control.UniqueID);
798 [EditorBrowsable (EditorBrowsableState.Advanced)]
799 public virtual void RegisterRequiresRaiseEvent (IPostBackEventHandler control)
801 requiresRaiseEvent = control;
804 [EditorBrowsable (EditorBrowsableState.Advanced)]
805 public virtual void RegisterStartupScript (string key, string script)
807 if (IsStartupScriptRegistered (key))
810 if (startupScriptBlocks == null)
811 startupScriptBlocks = new Hashtable ();
813 startupScriptBlocks.Add (key, script);
816 [EditorBrowsable (EditorBrowsableState.Advanced)]
817 public void RegisterViewStateHandler ()
819 handleViewState = true;
822 [EditorBrowsable (EditorBrowsableState.Advanced)]
823 protected virtual void SavePageStateToPersistenceMedium (object viewState)
825 _savedViewState = viewState;
828 [EditorBrowsable (EditorBrowsableState.Advanced)]
829 protected virtual object LoadPageStateFromPersistenceMedium ()
831 NameValueCollection postdata = DeterminePostBackMode ();
833 if (postdata == null || (view_state = postdata ["__VIEWSTATE"]) == null)
836 _savedViewState = null;
837 LosFormatter fmt = new LosFormatter ();
840 _savedViewState = fmt.Deserialize (view_state);
841 } catch (Exception e) {
842 throw new HttpException ("Error restoring page viewstate.\n", e);
845 return _savedViewState;
848 internal void LoadPageViewState()
850 object sState = LoadPageStateFromPersistenceMedium ();
851 if (sState != null) {
852 Pair pair = (Pair) sState;
853 LoadViewStateRecursive (pair.First);
854 _requiresPostBack = pair.Second as ArrayList;
858 internal void SavePageViewState ()
860 if (!handleViewState)
863 Pair pair = new Pair ();
864 pair.First = SaveViewStateRecursive ();
865 if (_requiresPostBack != null && _requiresPostBack.Count > 0)
866 pair.Second = _requiresPostBack;
868 if (pair.First == null && pair.Second == null)
871 SavePageStateToPersistenceMedium (pair);
874 public virtual void Validate ()
876 if (_validators == null || _validators.Count == 0){
881 bool all_valid = true;
882 foreach (IValidator v in _validators){
884 if (v.IsValid == false)
892 [EditorBrowsable (EditorBrowsableState.Advanced)]
893 public virtual void VerifyRenderingInServerForm (Control control)
896 throw new HttpException ("Control '" + control.ClientID + " " + control.GetType () +
897 "' must be rendered within a HtmlForm");
903 public string GetWebResourceUrl(Type type, string resourceName)
906 throw new ArgumentNullException ("type");
908 if (resourceName == null || resourceName.Length == 0)
909 throw new ArgumentNullException ("type");
911 return System.Web.Handlers.AssemblyResourceLoader.GetResourceUrl (type, resourceName);
916 internal void PushDataItemContext (object o)
918 if (dataItemCtx == null)
919 dataItemCtx = new Stack ();
921 dataItemCtx.Push (o);
924 internal void PopDataItemContext ()
926 if (dataItemCtx == null)
927 throw new InvalidOperationException ();
932 internal object CurrentDataItem {
934 if (dataItemCtx == null)
935 throw new InvalidOperationException ("No data item");
937 return dataItemCtx.Peek ();
941 protected object Eval (string expression)
943 return DataBinder.Eval (CurrentDataItem, expression);
946 protected object Eval (string expression, string format)
948 return DataBinder.Eval (CurrentDataItem, expression, format);
951 protected object XPath (string xpathexpression)
953 return XPathBinder.Eval (CurrentDataItem, xpathexpression);
956 protected object XPath (string xpathexpression, string format)
958 return XPathBinder.Eval (CurrentDataItem, xpathexpression, format);
961 protected IEnumerable XPathSelect (string xpathexpression)
963 return XPathBinder.Select (CurrentDataItem, xpathexpression);