When a server-side control processes its children (in the markup) as properties, it needs to instantiate
an object of the property type and assign it to the appropriate property of the control. Failing to do so
will cause markup which references properties to fail in certain cases (for instance when the control's
property type is a class and it is not instantiated by the control's constructor).
This adds support for the ProviderName attribute of the OutputCache directive in user controls.
Also implemented missing support for SqlDependency attribute.
* TemplateControlCompiler.cs: StaticPartialCachingControl instantiation now uses the constructor overloads
which accept sqlDependency (2.0+) and providerName (4.0+)
* UserControlCompiler.cs: added code to output PartialCachingAttribute which accepts sqlDependency (2.0+) and
ProviderName (4.0+) arguments
* PartialCachingAttribute.cs added the 4.0 ProviderName property
* StaticPartialCachingControl.cs: implemented two missing constructors (one 2.0 and the other 4.0)
Added a missing BuildCachedControl overload which accepts providerName (4.0)
* TemplateParser.cs: factored out OutputCache attribute processing to a separate internal virtual method.
* UserControlParser.cs: added support for the ProviderName attribute of the OutputCache directive.
fail to work on .NET 4.0 as well, for the most part. I will fix them next week.
2010-07-02 Marek Habersack <[email protected]>
* TemplateControlParser.cs: added support for ClientIDMode
property
* Control.cs: implemented 4.0 features - ClientIDMode and
RenderingCompatibility.
* ClientIDMode.cs, IDataKeysControl.cs: added
2010-07-02 Marek Habersack <[email protected]>
* Menu.cs: 4.0 API updates.
* GridView.cs: implemented 4.0 properties -
SortedAscendingCellStyle, SortedAscendingHeaderStyle,
SortedDescendingCellStyle, SortedDescendingHeaderStyle,
ClientIDRowSuffix, ClientIDRowSuffixDataKeys, ShowHeaderWhenEmpty
along with associated rendering changes.
* DetailsView.cs, FormView.cs, GridView.cs: 4.0 API changes -
renamed ShowPage to SetPageIndex and made it public.
Added 4.0 interfaces to inheritance list and implemented them.
* DataKeyArray.cs: added internal constructor which accepts IList
instead of ArrayList. Changed the 'keys' field type to IList.
* ContainedTable.cs: the 'id' attribute must be rendered last.
* CheckBox.cs, CheckBoxList.cs, SiteMapPath.cs, Table.cs,
TableStyle.cs, TextBox.cs, WebControl.cs: 4.0 rendering changes.
* Calendar.cs, CompositeControl.cs, DropDownList.cs, HyperLink.cs,
Image.cs, ImageButton.cs, Label.cs, LinkButton.cs, LoginName.cs,
Panel.cs, Table.cs, TableCell.cs, TableRow.cs:
added new 4.0 property, SupportsDisabledAttribute.
2010-07-02 Marek Habersack <[email protected]>
* VersionConverter.cs: added support for checking whether the
passed version is equal or more than a specified minimal version.
* PagesSection.cs: added two 4.0 properties - ClientIDMode and
ControlRenderingCompatibilityVersion
2010-07-02 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: added support for ClientIDMode 4.0
property
* PageCompiler.cs, UserControlCompiler.cs: AddStatementsToInitTop
must call the base implementation.
svn path=/trunk/mcs/; revision=159826
* ResourceExpressionBuilder.cs: cast the return value of
GetLocalResourceObject to appropriate type. Fixes bug #607766
* TemplateControlCompiler.cs: made CreateConvertToCall internal
static, so that it can be used from ResourceExpressionBuilder
svn path=/trunk/mcs/; revision=158909
* HtmlHead.cs: added code to render description and keywords metas
if the corresponding HtmlMeta controls aren't found and the user
set either Description or Keywords properties.
2010-06-01 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: added new virtual method,
AddStatementsToInitMethodBottom and renamed
AddStatementsToInitMethod to AddStatementsToInitMethodTop.
* PageCompiler.cs: code to set Meta{Description,Keywords}
properties, if present.
2010-06-01 Marek Habersack <[email protected]>
* PageParser.cs: added support for MetaDescription and
MetaKeywords main directive attributes
* Page.cs: implemented MetaDescription and MetaKeywords
4.0 properties.
svn path=/trunk/mcs/; revision=158303
* PageParser.cs: handle several main directive attributes
specially, as they can have expressions as their values. Fixes bug
#603532
* MainDirectiveAttribute.cs: added - helper class to handle
directive attributes which can take either a value or an
expression.
* BaseParser.cs: IsDirective, IsExpression and IsDataBound methods
moved to here from TemplateControlCompiler.
2010-05-19 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: IsDirective, IsExpression and
IsDataBound methods moved to System.Web.UI.BaseParser.
Made CompileExpression and GetFieldOrProperty methods internal.
* PageCompiler.cs: check several of the Page directive attributes
for expressions. Fixes bug #603532
* AspGenerator.cs, TagAttributes.cs: use IDictionary instead of
Hashtable
svn path=/trunk/mcs/; revision=157519
* TemplateControlCompiler.cs: AssignPropertyForResources localizes
a property even if the Localized attribute is absent. If the
attribute is present, it checks its IsLocalizable property to
decide if localization should be performed. Fixes bug #585933
svn path=/trunk/mcs/; revision=153164
* TemplateControlCompiler.cs: GetConverterForMember now completely
relies on TypeDescriptor and description providers to retrieve
converter for a property. Fixes bug #578586
If UrlPropertyAttribute is found for a member,
GetExpressionFromString uses the preconverted value, if any, as
parameter to HandleUrlProperty.
svn path=/trunk/mcs/; revision=152040
* TemplateControlCompiler.cs: GetConverterForMember looks up
member type converters using type description providers in
addition to custom attributes.
Result of GenerateInstance isn't cast to the target type if the
type isn't public.
2009-12-08 Marek Habersack <[email protected]>
* TypeDescriptor.cs: AddProvider overloads must refresh the
instance and type when called.
If GetProvider (object) fails to look up provider for the passed
instance, it attempts to look up provider for the instance's
type.
GetProvider (Type) looks for providers using all the parent types
of the passed type if no provider for it is found.
WrappedTypeDescriptionProvider.GetTypeDescriptor chains up to the
wrapped type, if present.
* TypeDescriptionProvider.cs: GetTypeDescriptor properly returns
the value obtained from parent in GetTypeDescriptor.
2009-12-08 Marek Habersack <[email protected]>
* Type.cs: added overloads for the == and != operators (4.0).
svn path=/trunk/mcs/; revision=147889
- made sure invariant culture is used with String.ToLower, String.ToUpper and String.Compare
- replaced all calls to CultureInfo.InvariantCulture with a reference to a static field System.Web.Util.Helpers.InvariantCulture
svn path=/trunk/mcs/; revision=143587
* HttpContext.cs: GetResourceProvider - renamed the 'key' argument
to 'virtualPath' in order to reflects its purpose better. Local
resource providers are created for the passed virtualPath and not
for the current request's path. Fixes bug #542484
2009-09-28 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: ResourceProviderHasObject calls
HttpContext.GetResourceProvider with the current file's path, not
current request's. Fixes situations when localized control lives
in a master page or user control. Fixes bug #542484
* BaseCompiler.cs: introduced a helper property InputVirtualPath
which returns a VirtualPath object for the current control's
virtual path.
svn path=/trunk/mcs/; revision=142773
* ThemeDirectoryBuildProvider.cs: use new AspGenerator constructor
which takes AspComponentFoundery as its
parameter. AspGenerator.RootBuilder isn't initialized until after
the parser is initialized.
* TemplateControlCompiler.cs: make sure to call
ProcessGeneratedCode on each instance of ControlBuilder after it's
fully generated. Fixes bug #500075
* TemplateBuildProvider.cs: moved the directive regex to
AspGenerator
* BaseCompiler.cs: added two internal properties, BaseType and
DerivedType, which are used in calls to
ControlBuilder.ProcessGeneratedCode. Fixes bug #500075
* AspGenerator.cs: implemented a work around for our parser
limitation which is unable to extract the page/control's base type
before parsing the actual file contents. This is necessary to
support ASP.NET MVC's "generic" Inherits attribute. The reason we
need to find out what the base type is before parsing the file is
that we need to look at the type's custom attributes to see if a
root control builder type is specified (which is what ASP.NET MVC
does) and, if yes, use it instead of the default type. Fixes bug
#500075
2009-05-04 Marek Habersack <[email protected]>
* TemplateParser.cs: take RootBuilder from the associated
generator.
Allow the main page directive to be added twice if the parser
needs it. Used by AspGenerator when extracting the inherited type
name before actual parsing. Fixes bug #500075
* FileLevelControlBuilderAttribute.cs,
FileLevelPageControlBuilder.cs, FileLevelUserControlBuilder.cs:
implemented
* ControlBuilder.cs: added a new internal property,
DataBindingMethod.
Implemented ProcessGeneratedCode.
svn path=/trunk/mcs/; revision=133500
* HttpContext.cs: local resources code now uses the custom
resource provider factory, just like the global resources
code. Fixes bug #493263
2009-04-16 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs:
AssignPropertyFromResources now checks whether the field/property
passed to it is decorated with the Localizable custom attribute
and whether the resource provider contains an entry for that
property.
svn path=/trunk/mcs/; revision=131888
* TemplateControlCompiler.cs: using a regexp to check whether an
expression is a Bind one. Fixes bug #493639
2009-04-16 Marek Habersack <[email protected]>
* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/NoBindForMethodsWithBindInName.aspx
2009-04-16 Marek Habersack <[email protected]>
* TemplateControlCompilerTest.cs: added test for bug #493639
svn path=/trunk/mcs/; revision=131874
* TemplateControlCompiler.cs: GenerateExpressionFromString doesn't
assume that the passed member is a property anymore. Fixes bug
#492252
svn path=/trunk/mcs/; revision=131210
* System.Web/HttpApplicationFactory.cs: check of global.asax was precompiled.
* System.Web.UI/MasterPage.cs: the items in ContentPlaceHolders are lowercase.
* System.Web.Compilation/TemplateControlCompiler.cs: lowercase place holder names
* System.Web.Compilation/BuildManager.cs: initial support for
precompilation. No 'updatable', please.
svn path=/trunk/mcs/; revision=127352
* CodeBuilder.cs, RootBuilder.cs, CollectionBuilder.cs: updates
related to ControlBuilder cleanup.
* ControlBuilder.cs: code cleanup - no field should be visible
outside the class unless it's a constant or a read-only field.
2009-01-13 Marek Habersack <[email protected]>
* XmlBuilder.cs: updates related to ControlBuilder cleanup.
2009-01-13 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs, AspGenerator.cs, BaseCompiler.cs,
GlobalAsaxCompiler.cs, PageThemeCompiler.cs: updates related to
ControlBuilder cleanup.
svn path=/trunk/mcs/; revision=123229
* TemplateParser.cs: in the 2.0 profile when a custom control is
registered, do not compile it right away but store the tag name in
a registry to be compiled at a later stage.
2008-12-11 Marek Habersack <[email protected]>
* BaseCompiler.cs: added a new method, InitializeType, to be
overriden in child classes when any class initialization needs to
be performed before methods, constructors and fields are created.
* TemplateControlCompiler.cs: if the parser has any custom
controls registered, compile them here - in the InitializeType
method.
svn path=/trunk/mcs/; revision=121262
* NunitWebResources/ValidPropertyBind5.aspx: added
* NunitWebResources/ReadWritePropertyControl.ascx: added a
writable string property.
2008-12-08 Marek Habersack <[email protected]>
* TemplateControlCompilerTest.cs: added another valid Bind
expression test.
2008-12-08 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: use the correct regex match group
index in SanitizeBindCall (), fixes bug #457011
svn path=/trunk/mcs/; revision=120988
* TemplateControlCompiler.cs: instead of adding ContentPlaceHolder
instances to the ContentPlaceHolders collection when the
placeholder is instantiated in the control build method, collect
the ids and store them in ContentPlaceHolders inside the
constructor. Fixes bug #449970
For each content placeholder generate a public virtual property
named "Template_PLACEHOLDERID", this is compatible with what .NET
does.
* BaseCompiler.cs: added new virtual method,
AddStatementsToConstructor, which is called just before
CreateConstructor returns.
2008-12-01 Marek Habersack <[email protected]>
* MasterPage.cs: use List <string> for ContentPlaceHolders instead
of ArrayList.
CreateMasterPage now directly accesses the ContentPlaceHolders as
it is now a list of strings
svn path=/trunk/mcs/; revision=120353
* TemplateControlCompiler.cs: make the Bind regex stricter.
When creating Eval expression from Bind, replace single quotes
with double quotes. Fixes bug #447597
When processing Bind expressions and the regex doesn't match,
throw an exception.
2008-11-21 Marek Habersack <[email protected]>
* ControlBuilder.cs: in BindingContainerType if builder is a
RootBuilder and no naming container is found, return typeof
(Page). In the TemplateBuilder case return cb.ControlType, not
this.ControlType.
svn path=/trunk/mcs/; revision=119661
* TemplateControlCompiler.cs: If BindingDirection of the parent
template builder is OneWay in
RegisterBindingInfo, do not throw an exception but simply do not
register the binding.
svn path=/trunk/mcs/; revision=118813
* TemplateControlCompiler.cs: treat Eval and Bind expressions as
verbatim code. The only difference between the two is that in the
latter case Bind is replaced with Eval in the output code. Fixes
bug #444725
2008-11-14 Marek Habersack <[email protected]>
* DataBinder.cs: if Eval doesn't find the indicated property, try
to find an indexer property on the object and use the expression
value as its parameter. Fixes#444725
svn path=/trunk/mcs/; revision=118799
* TemplateControlCompiler.cs: IsWritablePropertyOrField doesn't
use PropertyInfo.CanWrite to check whether the property is
writable anymore, it calls GetSetMethod (false) instead.
svn path=/trunk/mcs/; revision=115941
* TemplateControlCompiler.cs: templates must be instantiated even
for builders which process children as properties.
svn path=/trunk/mcs/; revision=115217
* ControlBuilder.cs: CreatePropertyBuilder now correctly processes
property names with prefixes (e.g. 'prefix:PropertyName').
Original, parsed, tag name is stored to properly handle closing
tags.
2008-09-01 Marek Habersack <[email protected]>
* AspGenerator.cs:
CloseControl uses ControlBuilder's OriginalTagName property,
should the property/tag name be prefixed with 'prefix:'
svn path=/trunk/mcs/; revision=112003
* TemplateControlCompiler.cs:
Templates are processed before anything else, so that children
which may depend on parent's templates can get access to them.
2008-08-31 Marek Habersack <[email protected]>
* Control.cs: improved FillControlCache
* ControlBuilder.cs:
Added a cache for children of TemplateBuilder, used later in
TemplateControlCompiler.
svn path=/trunk/mcs/; revision=111990
* TemplateParser.cs: added support for the LinePragmas directive
attribute.
* ControlBuilder.cs: if this instance is a TemplateBuilder do not
call MyNamingContainer, so that our own ContainerType can be used
as the binding container (if present).
2008-08-31 Marek Habersack <[email protected]>
* TemplateControlCompiler.cs: trust builder.BindingContainerType
in the 2.0+ profile - do not use container properties to detect
the type.
Added a helper method, compiled only when DEBUG is defined, to
generate Console.WriteLine CodeDOM calls.
* BaseCompiler.cs: add line pragmas only if enabled for the
current file.
svn path=/trunk/mcs/; revision=111983
* TemplateControlCompiler.cs: process expression when they are
used used in values of attributes without associated
properties. Fixes bug #417883
* ResourceExpressionBuilder.cs: added two overloads of
CreateGetLocalResourceObject to encompass cases when the generated
expression is not assigned to a property but rather used as a
parameter to the SetAttribute method. Fixes bug #417883
svn path=/trunk/mcs/; revision=110844
* TemplateControlCompiler.cs: .NET allows for whitespace between
the directive start (<%) and the directive type character. Added
code which copes with such situations correctly.
svn path=/trunk/mcs/; revision=110441
* TemplateControlCompiler.cs: rewrote the Bind regular expressions
to allow for single quotes and an optional second parameter to the
"call".
Added an Eval regular expression.
Both Bind and Eval calls in data expressions are now converted
into a CodeDOM method invocations, to allow support for possible
languages which use a different call format (previously code
snippets were used)
Added a method to construct the Eval invoke expression which
simplifies code in other areas.
2008-08-13 Marek Habersack <[email protected]>
* TemplateBuilder.cs: use a generic List to store the bindings on
2.0+
2008-08-13 Marek Habersack <[email protected]>
* HttpException.cs: do not use StringBuilder.AppendFormat when
there is no need.
svn path=/trunk/mcs/; revision=110385
* TemplateControlCompiler.cs: handle situation when a property of
a control for which we're generating the code is of type
'Type'. In such case, variable.GetType() will return
System.MonoType, which must not be output to the generated
source. Thanks to Robert Jordan for giving the idea for the hack!
svn path=/trunk/mcs/; revision=109773