using System.Collections.Generic;
#endif
using System.Text;
+using System.Collections.Specialized;
+using System.Web.Util;
namespace System.Web.UI
{
Hashtable hiddenFields;
ScriptEntry submitStatements;
ScriptEntry scriptIncludes;
+ Hashtable expandoAttributes;
Page page;
#if NET_2_0
List <int> eventValidationValues;
RegisterScript (ref scriptIncludes, type, "resource-" + resourceName, GetWebResourceUrl (type, resourceName), false);
}
- [MonoTODO]
- public void RegisterExpandoAttribute (string controlId,
- string name,
- string value)
+ public void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue)
{
- throw new NotImplementedException ();
+ RegisterExpandoAttribute (controlId, attributeName, attributeValue, true);
}
- [MonoTODO]
- public void RegisterExpandoAttribute(string controlId,
- string attributeName,
- string attributeValue,
- bool encode)
+ public void RegisterExpandoAttribute (string controlId, string attributeName, string attributeValue, bool encode)
{
- throw new NotImplementedException ();
+ if (controlId == null)
+ throw new ArgumentNullException ("controlId");
+
+ if (attributeName == null)
+ throw new ArgumentNullException ("attributeName");
+
+ if (expandoAttributes == null)
+ expandoAttributes = new Hashtable ();
+
+ ListDictionary list = (ListDictionary)expandoAttributes [controlId];
+ if (list == null) {
+ list = new ListDictionary ();
+ expandoAttributes [controlId] = list;
+ }
+
+ list.Add (attributeName, encode ? StrUtils.EscapeQuotesAndBackslashes (attributeValue) : attributeValue);
}
// Implemented following the description in http://odetocode.com/Blogs/scott/archive/2006/03/20/3145.aspx
{
get { return "__EVENTVALIDATION"; }
}
+
+ internal void WriteExpandoAttributes (HtmlTextWriter writer)
+ {
+ if (expandoAttributes == null)
+ return;
+
+ writer.WriteLine ();
+ writer.WriteLine ("<script type=\"text/javascript\">");
+ writer.WriteLine ("<!--");
+
+ foreach (string controlId in expandoAttributes.Keys) {
+ writer.WriteLine ("var {0} = document.all ? document.all [\"{0}\"] : document.getElementById (\"{0}\");", controlId);
+ ListDictionary attrs = (ListDictionary) expandoAttributes [controlId];
+ foreach (string attributeName in attrs.Keys) {
+ writer.WriteLine ("{0}.{1} = \"{2}\";", controlId, attributeName, attrs [attributeName]);
+ }
+ }
+ writer.WriteLine ("// -->");
+ writer.WriteLine ("</script>");
+ writer.WriteLine ();
+ }
#endif
internal void WriteHiddenFields (HtmlTextWriter writer)
-2006-11-13 Marek Habersack <grendello@gmail.com>
-
- * FileUtils.cs: Added a utility class for temporary file creation
- (and possibly other future common file operations)
-
-2006-03-15 Vladimir Krasnov <vladimirk@mainsoft.com>
-
- * DataSourceResolver.cs: corrected exceptions type in
- ResolveDataSource
-
-2006-02-01 Chris Toshok <toshok@ximian.com>
-
- * WebEncoding.cs: CONFIGURATION_2_0 => NET_2_0, and use GetSection
- instead of GetWebApplicationSection.
-
-2006-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: more than one consecutive slash are turned into one.
-
-2006-01-26 Chris Toshok <toshok@ximian.com>
-
- * WebEncoding.cs: rework this so we cache the section, and so we
- swallow exceptions based on a broken configuration.
-
-2006-01-09 Konstantin Triger <kostat@mainsoft.com>
-
- AltSerialization.cs: under TARGET_JVM: merging /main/4
-
-2005-11-28 Chris Toshok <toshok@ximian.com>
-
- * WebEncoding.cs (FileEncoding, ResponseEncoding,
- RequestEncoding): CONFIGURATION_2_0 work.
-
-2005-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: fix GetFile to work with '/blah'.
-
-2005-09-11 Sebastien Pouliot <sebastien@ximian.com>
-
- * IWebObjectFactory.cs: New. 2.0 interface.
- * IWebPropertyAccessor.cs: New. 2.0 interface.
- * Transactions.cs: Added [Link|Inheritance]Demand for Minimal.
- * WorkItem.cs: Added [Link|Inheritance]Demand for Minimal. Added
- Demand for UnmanagedCode on the static Post method,
-
-2005-08-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: removed 2 unused methods. IsRelativeUrl returns false if
- there's a colon in the string, assuming it's the beginning of the ://
- after the schema.
-
-2005-07-15 Ben Maurer <bmaurer@ximian.com>
-
- * DataSourceHelper.cs: Obsolete
-
- * DataSourceResolver.cs: Moved from DataSourceHelper.
-
-2005-07-14 Ben Maurer <bmaurer@ximian.com>
-
- * DataSourceHelper.cs: Helper method used for data binding.
-
-2005-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: (Combine) if the base path is "~", expand it.
-
-2005-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * StrUtils.cs: new string utilities.
-
-2005-05-09 Ben Maurer <bmaurer@ximian.com>
-
- * UrlUtils.cs (Reduce): a more efficient impl that avoids an
- arraylist, making an arraylist into an array, and a replace
- operation.
-
-2004-11-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: made (Insert|Get|Remove)SessionId use the appRoot +
- SessionID + vpath format.
-
-2004-07-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: don't pass double slash when the path begins with a
- tilde. Fixes bug #61654.
-
-2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs:
- (GetFile): not public, and fixed to really return just the file name.
- (InsertSessionId): ensure that the directory ends with a "/". This
- fixes cookieless sessions.
- (RemoveSessionId): don't return "/" twice.
-
- Fixed bug #59051.
-
-2004-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: respect trailing slashes. Fixes bug #56802.
-
-2004-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: no more ^Ms.
-
-2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: MakeRelative was returning null for virtual paths without
- directory.
-
-2004-04-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * FileAction.cs:
- * FileChangeEventHandler.cs:
- * FileChangedEventArgs.cs:
- * FileChangesMonitor.cs:
- * FilePathParser.cs: removed unused/obsolete files.
-
-2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: fixed MakeRelative. nGallery goes one step further.
-
-2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: small fix from George Kodinov for Combine when ~ is used.
-
-2004-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: ~ is not always /. Fixed.
-
-2004-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs:
- (Combine): handle subdirectories and tilde. Fixes bug 54231.
-
-2004-02-01 Alon Gazit <along@mainsoft.com>
-
- * UrlUtils.cs: little fix in GetDirectory ().
-
-2004-01-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
- * TransactedCallback.cs:
- * WorkItemCallback.cs:
- * WorkItem.cs:
- * Transactions.cs: Added and stubbed/ implemented
-
-2004-01-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>
-
- * WebEqualComparer.cs:
- * WebHashCodeProvider.cs:
- * FileAction.cs:
- * FileChangeEventHandler.cs:
- * NativeFileChangeEventHandler.cs: Monostyled header, internalized
-
-2004-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: make reduce not to throw an exception for '../'. Fixes
- bug #52599.
-
-2003-12-03 Jackson Harper <jackson@ximian.com>
-
- * UrlUtils.cs: Some methods for working with session ids in urls.
-
-2003-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * WebEncoding.cs: use the Default encoding when the globalization
- configuration is not available.
-
-2003-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: don't forget basePath when relative path is not rooted.
- Fixes bug #51522.
-
-2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: fix bug introduced with last change that makes relative
- paths fail. Closes bug #51448.
-
-2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * UrlUtils.cs: fixed Combine() handling of ~.
-
-2003-11-25 Jackson Harper <jackson@ximian.com>
-
- * AltSerialization.cs: Utility methods for optimized serializing.
-
-2003-11-13 Jackson Harper <jackson@ximian.com>
-
- * TimeUtil.cs: Utility methods for dealing with time.
-
-2003-11-08 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * UrlUtils.cs: new function to do the app mapping, but make
- it return a physical path.
-
-2003-11-07 Ben Maurer <bmaurer@users.sourceforge.net>
-
- * UrlUtils.cs: add a new function for mapping app absolute
- paths to virual paths (ie, ~/blah/ to /application/root/blah/)
-
+2006-11-26 Igor Zelmanovich <igorz@mainsoft.com>\r
+\r
+ * StrUtils.cs: added new helper method EscapeQuotesAndBackslashes\r
+\r
+2006-11-13 Marek Habersack <grendello@gmail.com>\r
+\r
+ * FileUtils.cs: Added a utility class for temporary file creation\r
+ (and possibly other future common file operations)\r
+\r
+2006-03-15 Vladimir Krasnov <vladimirk@mainsoft.com>\r
+\r
+ * DataSourceResolver.cs: corrected exceptions type in \r
+ ResolveDataSource\r
+\r
+2006-02-01 Chris Toshok <toshok@ximian.com>\r
+\r
+ * WebEncoding.cs: CONFIGURATION_2_0 => NET_2_0, and use GetSection\r
+ instead of GetWebApplicationSection.\r
+\r
+2006-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: more than one consecutive slash are turned into one.\r
+\r
+2006-01-26 Chris Toshok <toshok@ximian.com>\r
+\r
+ * WebEncoding.cs: rework this so we cache the section, and so we\r
+ swallow exceptions based on a broken configuration.\r
+\r
+2006-01-09 Konstantin Triger <kostat@mainsoft.com>\r
+\r
+ AltSerialization.cs: under TARGET_JVM: merging /main/4\r
+\r
+2005-11-28 Chris Toshok <toshok@ximian.com>\r
+\r
+ * WebEncoding.cs (FileEncoding, ResponseEncoding,\r
+ RequestEncoding): CONFIGURATION_2_0 work.\r
+\r
+2005-09-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: fix GetFile to work with '/blah'.\r
+\r
+2005-09-11 Sebastien Pouliot <sebastien@ximian.com>\r
+\r
+ * IWebObjectFactory.cs: New. 2.0 interface.\r
+ * IWebPropertyAccessor.cs: New. 2.0 interface.\r
+ * Transactions.cs: Added [Link|Inheritance]Demand for Minimal.\r
+ * WorkItem.cs: Added [Link|Inheritance]Demand for Minimal. Added \r
+ Demand for UnmanagedCode on the static Post method,\r
+\r
+2005-08-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: removed 2 unused methods. IsRelativeUrl returns false if\r
+ there's a colon in the string, assuming it's the beginning of the ://\r
+ after the schema.\r
+\r
+2005-07-15 Ben Maurer <bmaurer@ximian.com>\r
+\r
+ * DataSourceHelper.cs: Obsolete\r
+\r
+ * DataSourceResolver.cs: Moved from DataSourceHelper.\r
+\r
+2005-07-14 Ben Maurer <bmaurer@ximian.com>\r
+\r
+ * DataSourceHelper.cs: Helper method used for data binding.\r
+\r
+2005-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: (Combine) if the base path is "~", expand it.\r
+\r
+2005-06-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * StrUtils.cs: new string utilities.\r
+\r
+2005-05-09 Ben Maurer <bmaurer@ximian.com>\r
+\r
+ * UrlUtils.cs (Reduce): a more efficient impl that avoids an\r
+ arraylist, making an arraylist into an array, and a replace\r
+ operation.\r
+\r
+2004-11-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: made (Insert|Get|Remove)SessionId use the appRoot +\r
+ SessionID + vpath format.\r
+\r
+2004-07-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: don't pass double slash when the path begins with a\r
+ tilde. Fixes bug #61654.\r
+\r
+2004-05-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs:\r
+ (GetFile): not public, and fixed to really return just the file name.\r
+ (InsertSessionId): ensure that the directory ends with a "/". This\r
+ fixes cookieless sessions.\r
+ (RemoveSessionId): don't return "/" twice.\r
+\r
+ Fixed bug #59051.\r
+\r
+2004-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: respect trailing slashes. Fixes bug #56802.\r
+\r
+2004-05-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: no more ^Ms.\r
+\r
+2004-04-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: MakeRelative was returning null for virtual paths without\r
+ directory.\r
+\r
+2004-04-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * FileAction.cs:\r
+ * FileChangeEventHandler.cs:\r
+ * FileChangedEventArgs.cs:\r
+ * FileChangesMonitor.cs:\r
+ * FilePathParser.cs: removed unused/obsolete files.\r
+\r
+2004-04-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: fixed MakeRelative. nGallery goes one step further.\r
+\r
+2004-03-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: small fix from George Kodinov for Combine when ~ is used. \r
+\r
+2004-02-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: ~ is not always /. Fixed.\r
+\r
+2004-02-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs:\r
+ (Combine): handle subdirectories and tilde. Fixes bug 54231.\r
+\r
+2004-02-01 Alon Gazit <along@mainsoft.com>\r
+\r
+ * UrlUtils.cs: little fix in GetDirectory ().\r
+\r
+2004-01-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>\r
+\r
+ * TransactedCallback.cs:\r
+ * WorkItemCallback.cs:\r
+ * WorkItem.cs:\r
+ * Transactions.cs: Added and stubbed/ implemented\r
+\r
+2004-01-11 Andreas Nahr <ClassDevelopment@A-SoftTech.com>\r
+\r
+ * WebEqualComparer.cs:\r
+ * WebHashCodeProvider.cs:\r
+ * FileAction.cs:\r
+ * FileChangeEventHandler.cs:\r
+ * NativeFileChangeEventHandler.cs: Monostyled header, internalized\r
+\r
+2004-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: make reduce not to throw an exception for '../'. Fixes\r
+ bug #52599.\r
+\r
+2003-12-03 Jackson Harper <jackson@ximian.com>\r
+\r
+ * UrlUtils.cs: Some methods for working with session ids in urls.\r
+ \r
+2003-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * WebEncoding.cs: use the Default encoding when the globalization\r
+ configuration is not available.\r
+\r
+2003-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: don't forget basePath when relative path is not rooted.\r
+ Fixes bug #51522.\r
+\r
+2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: fix bug introduced with last change that makes relative\r
+ paths fail. Closes bug #51448.\r
+\r
+2003-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
+\r
+ * UrlUtils.cs: fixed Combine() handling of ~.\r
+\r
+2003-11-25 Jackson Harper <jackson@ximian.com>\r
+\r
+ * AltSerialization.cs: Utility methods for optimized serializing.\r
+ \r
+2003-11-13 Jackson Harper <jackson@ximian.com>\r
+\r
+ * TimeUtil.cs: Utility methods for dealing with time.\r
+ \r
+2003-11-08 Ben Maurer <bmaurer@users.sourceforge.net>\r
+\r
+ * UrlUtils.cs: new function to do the app mapping, but make\r
+ it return a physical path.\r
+\r
+2003-11-07 Ben Maurer <bmaurer@users.sourceforge.net>\r
+\r
+ * UrlUtils.cs: add a new function for mapping app absolute\r
+ paths to virual paths (ie, ~/blah/ to /application/root/blah/)\r
+\r
2003-11-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>\r
\r
* WebEncoding.cs: added properties to access configuration files\r