using System.Web.Compilation;
using System.Web.Configuration;
using System.Web.Util;
+using System.IO;
namespace System.Web.UI
{
#if NET_2_0
string masterPage;
Type masterType;
+ string title;
+ string theme;
+ string styleSheetTheme;
+ bool enable_event_validation;
#endif
public PageParser ()
AddApplicationAssembly ();
}
+#if NET_2_0
+ internal PageParser (string virtualPath, TextReader reader, HttpContext context)
+ {
+ Context = context;
+ BaseVirtualDir = UrlUtils.GetDirectory (virtualPath);
+ Reader = reader;
+ SetBaseType (PagesConfig.PageBaseType);
+ AddApplicationAssembly ();
+ }
+#endif
+
public static IHttpHandler GetCompiledPageInstance (string virtualPath,
string inputFile,
HttpContext context)
IHttpHandler h = (IHttpHandler) pp.GetCompiledInstance ();
return h;
}
-
+
internal override void ProcessMainAttributes (Hashtable atts)
{
string enabless = GetString (atts, "EnableSessionState",
-#if CONFIGURATION_2_0
+#if NET_2_0
PagesConfig.EnableSessionState.ToString()
#else
PagesConfig.EnableSessionState
CultureInfo ci = null;
try {
- ci = new CultureInfo (culture);
+#if NET_2_0
+ if (!culture.StartsWith ("auto"))
+#endif
+ ci = new CultureInfo (culture);
} catch {
ThrowParseException ("Unsupported Culture: " + culture);
}
- if (ci.IsNeutralCulture) {
+ if (ci != null && ci.IsNeutralCulture) {
string suggestedCulture = SuggestCulture (culture);
string fmt = "Culture attribute must be set to a non-neutral Culture.";
if (suggestedCulture != null)
if (uiculture != null) {
CultureInfo ci = null;
try {
- ci = new CultureInfo (uiculture);
+#if NET_2_0
+ if (!uiculture.StartsWith ("auto"))
+#endif
+ ci = new CultureInfo (uiculture);
} catch {
ThrowParseException ("Unsupported Culture: " + uiculture);
}
- if (ci.IsNeutralCulture) {
+ if (ci != null && ci.IsNeutralCulture) {
string suggestedCulture = SuggestCulture (uiculture);
string fmt = "UICulture attribute must be set to a non-neutral Culture.";
if (suggestedCulture != null)
validateRequest = GetBool (atts, "ValidateRequest", PagesConfig.ValidateRequest);
clientTarget = GetString (atts, "ClientTarget", null);
if (clientTarget != null) {
+#if NET_2_0
+ ClientTargetSection sec = (ClientTargetSection)WebConfigurationManager.GetSection ("system.web/clientTarget");
+ if (sec.ClientTargets[clientTarget] == null) {
+ ThrowParseException (String.Format (
+ "ClientTarget '{0}' is an invalid alias. See the " +
+ "documentation for <clientTarget> config. section.",
+ clientTarget));
+ }
+ clientTarget = sec.ClientTargets[clientTarget].UserAgent;
+#else
NameValueCollection coll;
coll = (NameValueCollection) Context.GetConfig ("system.web/clientTarget");
if (coll == null || coll [clientTarget] == null) {
clientTarget));
}
clientTarget = (string) coll [clientTarget];
+#endif
}
notBuffer = !GetBool (atts, "Buffer", true);
// Make sure the page exists
if (masterPage != null)
MasterPageParser.GetCompiledMasterType (masterPage, MapPath (masterPage), HttpContext.Current);
+
+ title = GetString(atts, "Title", null);
+
+ theme = GetString (atts, "Theme", null);
+ styleSheetTheme = GetString (atts, "StyleSheetTheme", null);
+ enable_event_validation = GetBool (atts, "EnableEventValidation", true);
#endif
// Ignored by now
GetString (atts, "EnableViewStateMac", null);
}
#if NET_2_0
+ internal string Theme {
+ get { return theme; }
+ }
+
+ internal string StyleSheetTheme {
+ get { return styleSheetTheme; }
+ }
+
internal string MasterPageFile {
get { return masterPage; }
}
internal Type MasterType {
get { return masterType; }
}
+
+ internal string Title {
+ get { return title; }
+ }
+
+ internal bool EnableEventValidation {
+ get { return enable_event_validation; }
+ }
#endif
}
}