* System.Web/HttpRequest.cs: added ClientTarget internal property.
* System.Web.Compilation/PageCompiler.cs: override CreateConstructor
to add assignment for ClientTarget.
* System.Web.Configuration/HttpCapabilitiesBase.cs: ClientTarget takes
precedence over UserAgent.
* System.Web.UI/Page.cs: implemented ClientTarget.
* System.Web.UI/PageParser.cs: support for clientTarget and check for
validity.
svn path=/trunk/mcs/; revision=28811
+2004-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * PageCompiler.cs: override CreateConstructor to add assignment for
+ ClientTarget.
+
2004-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TemplateControlCompiler.cs: use CodeDelegateCreateExpression instead
this.pageParser = pageParser;
}
+ protected override void CreateConstructor (CodeStatementCollection localVars,
+ CodeStatementCollection trueStmt)
+ {
+ if (pageParser.ClientTarget != null) {
+ CodeExpression prop;
+ prop = new CodePropertyReferenceExpression (thisRef, "ClientTarget");
+ CodeExpression ct = new CodePrimitiveExpression (pageParser.ClientTarget);
+ if (localVars == null)
+ localVars = new CodeStatementCollection ();
+ localVars.Add (new CodeAssignStatement (prop, ct));
+ }
+
+ base.CreateConstructor (localVars, trueStmt);
+ }
+
protected override void AddInterfaces ()
{
base.AddInterfaces ();
+2004-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpCapabilitiesBase.cs: ClientTarget takes precedence over UserAgent.
+
2004-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* WebConfigurationSettings.cs: when the virtual path is not /, don't
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
//
// (C) 2002 Ximian, Inc (http://www.ximian.com)
-// (C) 2003 Novell, Inc (http://www.novell.com)
+// (C) 2003,2004 Novell, Inc (http://www.novell.com)
//
namespace System.Web.Configuration
public static HttpCapabilitiesBase GetConfigCapabilities (string configKey, HttpRequest request)
{
- string ua = request.UserAgent;
+ string ua = request.ClientTarget;
+ if (ua == null)
+ ua = request.UserAgent;
+
HttpBrowserCapabilities bcap = new HttpBrowserCapabilities ();
bcap.capabilities = CapabilitiesLoader.GetCapabilities (ua);
bcap.Init ();
+2004-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Page.cs: implemented ClientTarget.
+ * PageParser.cs: support for clientTarget and check for validity.
+
2004-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Control.cs:
bool handleViewState;
string viewStateUserKey;
NameValueCollection _requestValueCollection;
+ string clientTarget;
[EditorBrowsable (EditorBrowsableState.Never)]
protected const string postEventArgumentID = "__EVENTARGUMENT";
get { return _context.Cache; }
}
- [MonoTODO]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
[Browsable (false), DefaultValue ("")]
[WebSysDescription ("Value do override the automatic browser detection and force the page to use the specified browser.")]
public string ClientTarget
{
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
+ get { return (clientTarget == null) ? "" : clientTarget; }
+ set {
+ clientTarget = value;
+ if (value == "")
+ clientTarget = null;
+ }
}
[EditorBrowsable (EditorBrowsableState.Never)]
public void ProcessRequest (HttpContext context)
{
_context = context;
+ if (clientTarget != null)
+ Request.ClientTarget = clientTarget;
+
WireupAutomaticEvents ();
//-- Control execution lifecycle in the docs
//
using System;
using System.Collections;
+using System.Collections.Specialized;
using System.Globalization;
using System.Text;
using System.Web;
string uiculture;
string errorPage;
bool validateRequest;
+ string clientTarget;
Type baseType = typeof (Page);
public PageParser ()
errorPage = GetString (atts, "ErrorPage", null);
validateRequest = GetBool (atts, "ValidateRequest", PagesConfig.ValidateRequest);
+ clientTarget = GetString (atts, "ClientTarget", null);
+ if (clientTarget != null) {
+ NameValueCollection coll;
+ coll = (NameValueCollection) Context.GetConfig ("system.web/clientTarget");
+ if (coll == null || coll [clientTarget] == null) {
+ ThrowParseException (String.Format (
+ "ClientTarget '{0}' is an invalid alias. See the " +
+ "documentation for <clientTarget> config. section.",
+ clientTarget));
+ }
+ clientTarget = (string) coll [clientTarget];
+ }
// Ignored by now
GetString (atts, "Buffer", null);
- GetString (atts, "ClientTarget", null);
GetString (atts, "EnableViewStateMac", null);
GetString (atts, "SmartNavigation", null);
internal bool ValidateRequest {
get { return validateRequest; }
}
+
+ internal string ClientTarget {
+ get { return clientTarget; }
+ }
}
}
+2004-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HttpRequest.cs: added ClientTarget internal property.
+
2004-06-03 Lluis Sanchez Gual <lluis@ximian.com>
* HttpApplication.cs: Clear the http handler list after releasing the
private bool rewritten;
Stream userFilter;
HttpRequestStream requestFilter;
+ string clientTarget;
#if NET_1_1
bool validateCookies;
bool validateForm;
headers.MakeReadOnly ();
}
+ internal string ClientTarget {
+ get { return clientTarget; }
+ set {
+ if (value != clientTarget) {
+ clientTarget = value;
+ _browser = null;
+ }
+ }
+ }
+
#if NET_1_1
static void ValidateNameValueCollection (string name, NameValueCollection coll)
{