mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
This commit introduces a few 4.0 rendering changes which break some tests. The broken tests
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
This commit is contained in:
commit
d8838a6414
107 files changed
+17152
-418
No files matched your search
@@ -370,7 +370,7 @@ STANDALONE_TEST_COMPILABLE_TESTS = \
|
||||
endif
|
||||
|
||||
STANDALONE_TEST_RUNNER = Test/tools/standalone-runner.exe
|
||||
RUN_STANDALONE = $(TEST_RUNTIME) $(STANDALONE_TEST_RUNNER)
|
||||
RUN_STANDALONE = $(TEST_RUNTIME) $(STANDALONE_TEST_RUNNER) --output=StandaloneTestResult-$(PROFILE).log
|
||||
ifdef TESTNAME
|
||||
RUN_STANDALONE += --test=$(TESTNAME)
|
||||
endif
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
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.
|
||||
|
||||
2010-06-15 Marek Habersack <[email protected]>
|
||||
|
||||
* ResourceExpressionBuilder.cs: cast the return value of
|
||||
|
||||
@@ -318,6 +318,8 @@ namespace System.Web.Compilation
|
||||
|
||||
protected override void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method)
|
||||
{
|
||||
base.AddStatementsToInitMethodTop (builder, method);
|
||||
|
||||
ILocation directiveLocation = pageParser.DirectiveLocation;
|
||||
AddStatementsFromDirective (builder, method, directiveLocation);
|
||||
|
||||
|
||||
@@ -88,7 +88,8 @@ namespace System.Web.Compilation
|
||||
|
||||
protected void EnsureID (ControlBuilder builder)
|
||||
{
|
||||
if (builder.ID == null || builder.ID.Trim () == "")
|
||||
string id = builder.ID;
|
||||
if (id == null || id.Trim () == String.Empty)
|
||||
builder.ID = builder.GetNextID (null);
|
||||
}
|
||||
|
||||
@@ -424,6 +425,19 @@ namespace System.Web.Compilation
|
||||
|
||||
protected virtual void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method)
|
||||
{
|
||||
#if NET_4_0
|
||||
ClientIDMode? mode = parser.ClientIDMode;
|
||||
if (mode.HasValue) {
|
||||
var cimRef = new CodeTypeReferenceExpression (typeof (ClientIDMode));
|
||||
cimRef.Type.Options = CodeTypeReferenceOptions.GlobalReference;
|
||||
|
||||
var assign = new CodeAssignStatement ();
|
||||
assign.Left = new CodePropertyReferenceExpression (thisRef, "ClientIDMode");
|
||||
assign.Right = new CodeFieldReferenceExpression (cimRef, mode.Value.ToString ());
|
||||
|
||||
method.Statements.Add (assign);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected virtual void AddStatementsToInitMethodBottom (ControlBuilder builder, CodeMemberMethod method)
|
||||
|
||||
@@ -80,6 +80,7 @@ namespace System.Web.Compilation
|
||||
|
||||
protected override void AddStatementsToInitMethodTop (ControlBuilder builder, CodeMemberMethod method)
|
||||
{
|
||||
base.AddStatementsToInitMethodTop (builder, method);
|
||||
if (parser.MasterPageFile != null) {
|
||||
CodeExpression prop;
|
||||
prop = new CodePropertyReferenceExpression (new CodeArgumentReferenceExpression("__ctrl"), "MasterPageFile");
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
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-06-01 Marek Habersack <[email protected]>
|
||||
|
||||
* HttpRuntimeSection.cs: added 4.0 properties
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Authors:
|
||||
// Chris Toshok ([email protected])
|
||||
//
|
||||
// (C) 2005 Novell, Inc (http://www.novell.com)
|
||||
// (C) 2005-2010 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
|
||||
//
|
||||
@@ -28,8 +28,6 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
@@ -63,7 +61,10 @@ namespace System.Web.Configuration
|
||||
static ConfigurationProperty userControlBaseTypeProp;
|
||||
static ConfigurationProperty validateRequestProp;
|
||||
static ConfigurationProperty viewStateEncryptionModeProp;
|
||||
|
||||
#if NET_4_0
|
||||
static ConfigurationProperty clientIDModeProp;
|
||||
static ConfigurationProperty controlRenderingCompatibilityVersionProp;
|
||||
#endif
|
||||
static PagesSection ()
|
||||
{
|
||||
asyncTimeoutProp = new ConfigurationProperty ("asyncTimeout", typeof (TimeSpan), TimeSpan.FromSeconds (45.0),
|
||||
@@ -98,7 +99,15 @@ namespace System.Web.Configuration
|
||||
viewStateEncryptionModeProp = new ConfigurationProperty ("viewStateEncryptionMode", typeof (ViewStateEncryptionMode), ViewStateEncryptionMode.Auto,
|
||||
new GenericEnumConverter (typeof (ViewStateEncryptionMode)), PropertyHelper.DefaultValidator,
|
||||
ConfigurationPropertyOptions.None);
|
||||
|
||||
#if NET_4_0
|
||||
clientIDModeProp = new ConfigurationProperty ("clientIDMode", typeof (ClientIDMode), ClientIDMode.Predictable,
|
||||
new GenericEnumConverter (typeof (ClientIDMode)), PropertyHelper.DefaultValidator,
|
||||
ConfigurationPropertyOptions.None);
|
||||
controlRenderingCompatibilityVersionProp = new ConfigurationProperty ("controlRenderingCompatibilityVersion", typeof (Version), new Version (4, 0),
|
||||
new VersionConverter (3, 5, "The value for the property 'controlRenderingCompatibilityVersion' is not valid. The error is: The control rendering compatibility version must not be less than {1}."),
|
||||
PropertyHelper.DefaultValidator,
|
||||
ConfigurationPropertyOptions.None);
|
||||
#endif
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
properties.Add (asyncTimeoutProp);
|
||||
properties.Add (autoEventWireupProp);
|
||||
@@ -122,6 +131,10 @@ namespace System.Web.Configuration
|
||||
properties.Add (userControlBaseTypeProp);
|
||||
properties.Add (validateRequestProp);
|
||||
properties.Add (viewStateEncryptionModeProp);
|
||||
#if NET_4_0
|
||||
properties.Add (clientIDModeProp);
|
||||
properties.Add (controlRenderingCompatibilityVersionProp);
|
||||
#endif
|
||||
}
|
||||
|
||||
public PagesSection ()
|
||||
@@ -284,7 +297,24 @@ namespace System.Web.Configuration
|
||||
get { return (ViewStateEncryptionMode) base [viewStateEncryptionModeProp]; }
|
||||
set { base [viewStateEncryptionModeProp] = value; }
|
||||
}
|
||||
#if NET_4_0
|
||||
[ConfigurationProperty ("clientIDMode", DefaultValue = ClientIDMode.Predictable)]
|
||||
public ClientIDMode ClientIDMode {
|
||||
get { return (ClientIDMode) base [clientIDModeProp]; }
|
||||
set { base [clientIDModeProp] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("controlRenderingCompatibilityVersion", DefaultValue = "4.0")]
|
||||
public Version ControlRenderingCompatibilityVersion {
|
||||
get { return (Version) base [controlRenderingCompatibilityVersionProp]; }
|
||||
set {
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ("value");
|
||||
|
||||
base [controlRenderingCompatibilityVersionProp] = value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
@@ -298,4 +328,3 @@ namespace System.Web.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -32,11 +32,10 @@ using System;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
namespace System.Web.Configuration {
|
||||
|
||||
internal static class PropertyHelper {
|
||||
namespace System.Web.Configuration
|
||||
{
|
||||
static class PropertyHelper
|
||||
{
|
||||
internal static WhiteSpaceTrimStringConverter WhiteSpaceTrimStringConverter = new WhiteSpaceTrimStringConverter ();
|
||||
internal static InfiniteTimeSpanConverter InfiniteTimeSpanConverter = new InfiniteTimeSpanConverter ();
|
||||
internal static InfiniteIntConverter InfiniteIntConverter = new InfiniteIntConverter ();
|
||||
@@ -51,11 +50,9 @@ namespace System.Web.Configuration {
|
||||
|
||||
internal static IntegerValidator IntFromZeroToMaxValidator = new IntegerValidator (0, Int32.MaxValue);
|
||||
internal static IntegerValidator IntFromOneToMax_1Validator = new IntegerValidator (1, Int32.MaxValue - 1);
|
||||
|
||||
#if NET_4_0
|
||||
internal static VersionConverter VersionConverter = new VersionConverter ();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -34,6 +34,19 @@ namespace System.Web.Configuration
|
||||
{
|
||||
sealed class VersionConverter : ConfigurationConverterBase
|
||||
{
|
||||
Version minVersion;
|
||||
string exceptionText;
|
||||
|
||||
public VersionConverter ()
|
||||
{
|
||||
}
|
||||
|
||||
public VersionConverter (int minMajor, int minMinor, string exceptionText = null)
|
||||
{
|
||||
minVersion = new Version (minMajor, minMinor);
|
||||
this.exceptionText = exceptionText;
|
||||
}
|
||||
|
||||
public override object ConvertFrom (ITypeDescriptorContext ctx, CultureInfo ci, object data)
|
||||
{
|
||||
string input = data as string;
|
||||
@@ -45,6 +58,9 @@ namespace System.Web.Configuration
|
||||
if (!Version.TryParse (input, out result))
|
||||
throw new ConfigurationErrorsException ("The input string wasn't in correct format.");
|
||||
|
||||
if (minVersion != null && result < minVersion)
|
||||
throw new ConfigurationErrorsException (String.Format (exceptionText, result, minVersion));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -492,8 +492,11 @@ namespace System.Web.UI.WebControls
|
||||
return weekendDayStyle;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
// Private properties
|
||||
DateTimeFormatInfo DateInfo {
|
||||
get {
|
||||
|
||||
@@ -1,3 +1,30 @@
|
||||
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-06-21 Marek Habersack <[email protected]>
|
||||
|
||||
* BaseValidator.cs, BulletedList.cs, Calendar.cs, CheckBox.cs,
|
||||
|
||||
@@ -313,17 +313,22 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
bool need_span = ControlStyleCreated && !ControlStyle.IsEmpty;
|
||||
bool enabled = IsEnabled;
|
||||
if (!enabled) {
|
||||
#if NET_4_0
|
||||
if (!RenderingCompatibilityLessThan40)
|
||||
ControlStyle.PrependCssClass (DisabledCssClass);
|
||||
else
|
||||
#endif
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
|
||||
need_span = true;
|
||||
}
|
||||
|
||||
if (need_span) {
|
||||
AddDisplayStyleAttribute (w);
|
||||
ControlStyle.AddAttributesToRender (w, this);
|
||||
}
|
||||
|
||||
bool enabled = IsEnabled;
|
||||
if (!enabled) {
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
|
||||
need_span = true;
|
||||
}
|
||||
|
||||
|
||||
string tt = ToolTip;
|
||||
if (tt != null && tt.Length > 0){
|
||||
w.AddAttribute ("title", tt);
|
||||
@@ -332,7 +337,7 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
if (HasAttributes && AddAttributesForSpan (w))
|
||||
need_span = true;
|
||||
|
||||
|
||||
if (need_span)
|
||||
w.RenderBeginTag (HtmlTextWriterTag.Span);
|
||||
|
||||
@@ -359,9 +364,7 @@ namespace System.Web.UI.WebControls
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Name, nameAttr);
|
||||
InternalAddAttributesToRender (w, enabled);
|
||||
AddAttributesToRender (w);
|
||||
if (inputAttributes != null)
|
||||
inputAttributes.AddAttributes (w);
|
||||
|
||||
|
||||
if (Checked)
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Checked, "checked", false);
|
||||
|
||||
@@ -381,6 +384,10 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
if (common_attrs != null)
|
||||
common_attrs.AddAttributes (w);
|
||||
|
||||
if (inputAttributes != null)
|
||||
inputAttributes.AddAttributes (w);
|
||||
|
||||
w.RenderBeginTag (HtmlTextWriterTag.Input);
|
||||
w.RenderEndTag ();
|
||||
}
|
||||
|
||||
@@ -274,6 +274,9 @@ namespace System.Web.UI.WebControls
|
||||
{
|
||||
ListItem item = Items [repeatIndex];
|
||||
|
||||
string cssClass = check_box.CssClass;
|
||||
if (!String.IsNullOrEmpty (cssClass))
|
||||
check_box.CssClass = String.Empty;
|
||||
check_box.ID = repeatIndex.ToString (Helpers.InvariantCulture);
|
||||
check_box.Text = item.Text;
|
||||
check_box.AutoPostBack = AutoPostBack;
|
||||
@@ -290,7 +293,14 @@ namespace System.Web.UI.WebControls
|
||||
check_box.Attributes.Clear ();
|
||||
if (item.HasAttributes)
|
||||
check_box.Attributes.CopyFrom (item.Attributes);
|
||||
|
||||
#if NET_4_0
|
||||
if (!RenderingCompatibilityLessThan40) {
|
||||
var attrs = check_box.InputAttributes;
|
||||
|
||||
attrs.Clear ();
|
||||
attrs.Add ("value", item.Value);
|
||||
}
|
||||
#endif
|
||||
check_box.RenderControl (writer);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,11 @@ namespace System.Web.UI.WebControls
|
||||
[Designer ("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
|
||||
public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor
|
||||
{
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected CompositeControl ()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -44,9 +44,8 @@ namespace System.Web.UI.WebControls
|
||||
protected override void AddAttributesToRender (HtmlTextWriter writer)
|
||||
{
|
||||
ControlStyle.CopyFrom (_container.ControlStyle);
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Id, _container.ClientID);
|
||||
|
||||
base.AddAttributesToRender (writer);
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Id, _container.ClientID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,14 @@ namespace System.Web.UI.WebControls
|
||||
{
|
||||
public sealed class DataKeyArray : ICollection, IEnumerable, IStateManager
|
||||
{
|
||||
ArrayList keys;
|
||||
IList keys;
|
||||
bool trackViewState;
|
||||
|
||||
internal DataKeyArray (IList keys)
|
||||
{
|
||||
this.keys = keys;
|
||||
}
|
||||
|
||||
public DataKeyArray (ArrayList keys)
|
||||
{
|
||||
this.keys = keys;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace System.Web.UI.WebControls
|
||||
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
|
||||
#if NET_4_0
|
||||
, IDataBoundItemControl
|
||||
, IDataBoundItemControl, IDataBoundControl, IFieldControl
|
||||
#endif
|
||||
{
|
||||
object dataItem;
|
||||
@@ -319,7 +319,17 @@ namespace System.Web.UI.WebControls
|
||||
IDataSource IDataBoundControl.DataSourceObject {
|
||||
get { return base.DataSourceObject; }
|
||||
}
|
||||
#endif
|
||||
|
||||
IAutoFieldGenerator IFieldControl.FieldsGenerator {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
[WebCategoryAttribute ("Paging")]
|
||||
[DefaultValueAttribute (false)]
|
||||
public virtual bool AllowPaging {
|
||||
@@ -890,6 +900,7 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
[BrowsableAttribute(false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public IAutoFieldGenerator RowsGenerator {
|
||||
get;
|
||||
set;
|
||||
@@ -953,7 +964,14 @@ namespace System.Web.UI.WebControls
|
||||
int IDataItemContainer.DataItemIndex {
|
||||
get { return DataItemIndex; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[MonoTODO ("Make use of it in the code")]
|
||||
[DefaultValue (true)]
|
||||
public virtual bool EnableModelValidation {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
#endif
|
||||
public virtual bool IsBindableType (Type type)
|
||||
{
|
||||
return type.IsPrimitive || type == typeof (string) || type == typeof (DateTime) || type == typeof (Guid) || type == typeof (Decimal);
|
||||
@@ -1533,25 +1551,25 @@ namespace System.Web.UI.WebControls
|
||||
newIndex = paramIndex - 1;
|
||||
break;
|
||||
}
|
||||
ShowPage (newIndex);
|
||||
SetPageIndex (newIndex);
|
||||
break;
|
||||
|
||||
case DataControlCommands.FirstPageCommandArgument:
|
||||
ShowPage (0);
|
||||
SetPageIndex (0);
|
||||
break;
|
||||
|
||||
case DataControlCommands.LastPageCommandArgument:
|
||||
ShowPage (PageCount - 1);
|
||||
SetPageIndex (PageCount - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.NextPageCommandArgument:
|
||||
if (PageIndex < PageCount - 1)
|
||||
ShowPage (PageIndex + 1);
|
||||
SetPageIndex (PageIndex + 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.PreviousPageCommandArgument:
|
||||
if (PageIndex > 0)
|
||||
ShowPage (PageIndex - 1);
|
||||
SetPageIndex (PageIndex - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.EditCommandName:
|
||||
@@ -1579,8 +1597,10 @@ namespace System.Web.UI.WebControls
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPage (int newIndex)
|
||||
#if NET_4_0
|
||||
public
|
||||
#endif
|
||||
void SetPageIndex (int newIndex)
|
||||
{
|
||||
DetailsViewPageEventArgs args = new DetailsViewPageEventArgs (newIndex);
|
||||
OnPageIndexChanging (args);
|
||||
|
||||
@@ -81,7 +81,11 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
set { base.SelectedIndex = value; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
#endregion // Public Instance Properties
|
||||
|
||||
#region Protected Instance Methods
|
||||
|
||||
@@ -45,6 +45,9 @@ namespace System.Web.UI.WebControls
|
||||
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
public class FormView: CompositeDataBoundControl, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
|
||||
#if NET_4_0
|
||||
, IDataBoundItemControl, IDataBoundControl
|
||||
#endif
|
||||
{
|
||||
object dataItem;
|
||||
|
||||
@@ -793,8 +796,33 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
int IDataItemContainer.DisplayIndex {
|
||||
get { return PageIndex; }
|
||||
}
|
||||
|
||||
}
|
||||
#if NET_4_0
|
||||
[MonoTODO ("Make use of it in the code")]
|
||||
[DefaultValue (true)]
|
||||
public virtual bool EnableModelValidation {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
DataBoundControlMode IDataBoundItemControl.Mode {
|
||||
get {
|
||||
switch (CurrentMode) {
|
||||
case FormViewMode.ReadOnly:
|
||||
return DataBoundControlMode.ReadOnly;
|
||||
|
||||
case FormViewMode.Edit:
|
||||
return DataBoundControlMode.Edit;
|
||||
|
||||
case FormViewMode.Insert:
|
||||
return DataBoundControlMode.Insert;
|
||||
|
||||
default:
|
||||
throw new InvalidOperationException ("Unsupported mode value.");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
public virtual bool IsBindableType (Type type)
|
||||
{
|
||||
return type.IsPrimitive || type == typeof (string) || type == typeof (DateTime) || type == typeof (Guid) || type == typeof (Decimal);
|
||||
@@ -1222,25 +1250,25 @@ namespace System.Web.UI.WebControls
|
||||
newIndex = paramIndex - 1;
|
||||
break;
|
||||
}
|
||||
ShowPage (newIndex);
|
||||
SetPageIndex (newIndex);
|
||||
break;
|
||||
|
||||
case DataControlCommands.FirstPageCommandArgument:
|
||||
ShowPage (0);
|
||||
SetPageIndex (0);
|
||||
break;
|
||||
|
||||
case DataControlCommands.LastPageCommandArgument:
|
||||
ShowPage (PageCount - 1);
|
||||
SetPageIndex (PageCount - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.NextPageCommandArgument:
|
||||
if (PageIndex < PageCount - 1)
|
||||
ShowPage (PageIndex + 1);
|
||||
SetPageIndex (PageIndex + 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.PreviousPageCommandArgument:
|
||||
if (PageIndex > 0)
|
||||
ShowPage (PageIndex - 1);
|
||||
SetPageIndex (PageIndex - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.EditCommandName:
|
||||
@@ -1268,8 +1296,10 @@ namespace System.Web.UI.WebControls
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPage (int index)
|
||||
#if NET_4_0
|
||||
public
|
||||
#endif
|
||||
void SetPageIndex (int index)
|
||||
{
|
||||
FormViewPageEventArgs args = new FormViewPageEventArgs (index);
|
||||
OnPageIndexChanging (args);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Web.UI;
|
||||
@@ -45,6 +46,9 @@ namespace System.Web.UI.WebControls
|
||||
[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
|
||||
public class GridView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IPostBackEventHandler, IPostBackContainer, IPersistedSelector
|
||||
#if NET_4_0
|
||||
, IDataKeysControl, IDataBoundListControl, IDataBoundControl, IFieldControl
|
||||
#endif
|
||||
{
|
||||
Table table;
|
||||
GridViewRowCollection rows;
|
||||
@@ -59,7 +63,9 @@ namespace System.Web.UI.WebControls
|
||||
ITemplate emptyDataTemplate;
|
||||
|
||||
PropertyDescriptor[] cachedKeyProperties;
|
||||
|
||||
#if NET_4_0
|
||||
PropertyDescriptor[] cachedSuffixKeyProperties;
|
||||
#endif
|
||||
// View state
|
||||
DataControlFieldCollection columns;
|
||||
PagerSettings pagerSettings;
|
||||
@@ -72,7 +78,16 @@ namespace System.Web.UI.WebControls
|
||||
TableItemStyle pagerStyle;
|
||||
TableItemStyle rowStyle;
|
||||
TableItemStyle selectedRowStyle;
|
||||
ArrayList _dataKeyArrayList;
|
||||
#if NET_4_0
|
||||
TableItemStyle sortedAscendingCellStyle;
|
||||
TableItemStyle sortedAscendingHeaderStyle;
|
||||
TableItemStyle sortedDescendingCellStyle;
|
||||
TableItemStyle sortedDescendingHeaderStyle;
|
||||
|
||||
List <DataKey> _dataKeySuffixList;
|
||||
DataKeyArray rowSuffixKeys;
|
||||
#endif
|
||||
List <DataKey> _dataKeyList;
|
||||
DataKeyArray keys;
|
||||
DataKey oldEditValues;
|
||||
AutoGeneratedFieldProperties[] autoFieldProperties;
|
||||
@@ -106,6 +121,7 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
public GridView ()
|
||||
{
|
||||
EnableModelValidation = true;
|
||||
}
|
||||
|
||||
public event EventHandler PageIndexChanged {
|
||||
@@ -541,6 +557,9 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
[BrowsableAttribute(false)]
|
||||
#if NET_4_0
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
#endif
|
||||
public IAutoFieldGenerator ColumnsGenerator {
|
||||
get;
|
||||
set;
|
||||
@@ -562,21 +581,30 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList DataKeyArrayList {
|
||||
List <DataKey> DataKeyList {
|
||||
get {
|
||||
if (_dataKeyArrayList == null) {
|
||||
_dataKeyArrayList = new ArrayList ();
|
||||
}
|
||||
return _dataKeyArrayList;
|
||||
if (_dataKeyList == null)
|
||||
_dataKeyList = new List <DataKey> ();
|
||||
|
||||
return _dataKeyList;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
List <DataKey> DataKeySuffixList {
|
||||
get {
|
||||
if (_dataKeySuffixList == null)
|
||||
_dataKeySuffixList = new List <DataKey> ();
|
||||
|
||||
return _dataKeySuffixList;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
[BrowsableAttribute (false)]
|
||||
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
||||
public virtual DataKeyArray DataKeys {
|
||||
get {
|
||||
if (keys == null) {
|
||||
keys = new DataKeyArray (DataKeyArrayList);
|
||||
keys = new DataKeyArray (DataKeyList);
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager) keys).TrackViewState ();
|
||||
}
|
||||
@@ -678,7 +706,14 @@ namespace System.Web.UI.WebControls
|
||||
RequireBinding ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[MonoTODO ("Make use of it in the code")]
|
||||
[DefaultValue (true)]
|
||||
public virtual bool EnableModelValidation {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
||||
[BrowsableAttribute (false)]
|
||||
public virtual GridViewRow FooterRow {
|
||||
@@ -846,10 +881,9 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
|
||||
[DefaultValue (null)]
|
||||
/* DataControlPagerCell isnt specified in the docs */
|
||||
//[TemplateContainer (typeof(DataControlPagerCell), BindingDirection.OneWay)]
|
||||
[PersistenceMode (PersistenceMode.InnerProperty)]
|
||||
[Browsable (false)]
|
||||
[TemplateContainerAttribute(typeof(GridViewRow))]
|
||||
public virtual ITemplate PagerTemplate {
|
||||
get { return pagerTemplate; }
|
||||
set { pagerTemplate = value; }
|
||||
@@ -900,7 +934,7 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
[BrowsableAttribute (false)]
|
||||
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public virtual DataKey SelectedDataKey {
|
||||
get {
|
||||
if (DataKeyNames.Length == 0)
|
||||
@@ -914,7 +948,8 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
[BrowsableAttribute(false)]
|
||||
[Browsable(false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public virtual DataKey SelectedPersistedDataKey {
|
||||
get; set;
|
||||
}
|
||||
@@ -1066,7 +1101,121 @@ namespace System.Web.UI.WebControls
|
||||
RequireBinding ();
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[TypeConverter (typeof(StringArrayConverter))]
|
||||
[DefaultValue (null)]
|
||||
public virtual string[] ClientIDRowSuffix {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[BrowsableAttribute(false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public DataKeyArray ClientIDRowSuffixDataKeys {
|
||||
get {
|
||||
if (rowSuffixKeys == null) {
|
||||
rowSuffixKeys = new DataKeyArray (DataKeySuffixList);
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager) rowSuffixKeys).TrackViewState ();
|
||||
}
|
||||
|
||||
return rowSuffixKeys;
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultValue (false)]
|
||||
public virtual bool EnablePersistedSelection {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
IAutoFieldGenerator IFieldControl.FieldsGenerator {
|
||||
get {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
set {
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
|
||||
[DefaultValue (false)]
|
||||
public virtual bool ShowHeaderWhenEmpty {
|
||||
get { return ViewState.GetBool ("ShowHeaderWhenEmpty", false); }
|
||||
set {
|
||||
if (value == ShowHeaderWhenEmpty)
|
||||
return;
|
||||
|
||||
ViewState ["ShowHeaderWhenEmpty"] = value;
|
||||
RequireBinding ();
|
||||
}
|
||||
}
|
||||
|
||||
[PersistenceMode (PersistenceMode.InnerProperty)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
||||
[NotifyParentProperty (true)]
|
||||
public TableItemStyle SortedAscendingCellStyle {
|
||||
get {
|
||||
if (sortedAscendingCellStyle == null) {
|
||||
sortedAscendingCellStyle = new TableItemStyle ();
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager)sortedAscendingCellStyle).TrackViewState ();
|
||||
}
|
||||
|
||||
return sortedAscendingCellStyle;
|
||||
}
|
||||
}
|
||||
|
||||
[PersistenceMode (PersistenceMode.InnerProperty)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
||||
[NotifyParentProperty (true)]
|
||||
public TableItemStyle SortedAscendingHeaderStyle {
|
||||
get {
|
||||
if (sortedAscendingHeaderStyle == null) {
|
||||
sortedAscendingHeaderStyle = new TableItemStyle ();
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager)sortedAscendingHeaderStyle).TrackViewState ();
|
||||
}
|
||||
|
||||
return sortedAscendingHeaderStyle;
|
||||
}
|
||||
}
|
||||
|
||||
[PersistenceMode (PersistenceMode.InnerProperty)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
||||
[NotifyParentProperty (true)]
|
||||
public TableItemStyle SortedDescendingCellStyle {
|
||||
get {
|
||||
if (sortedDescendingCellStyle == null) {
|
||||
sortedDescendingCellStyle = new TableItemStyle ();
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager)sortedDescendingCellStyle).TrackViewState ();
|
||||
}
|
||||
|
||||
return sortedDescendingCellStyle;
|
||||
}
|
||||
}
|
||||
|
||||
[PersistenceMode (PersistenceMode.InnerProperty)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
|
||||
[NotifyParentProperty (true)]
|
||||
public TableItemStyle SortedDescendingHeaderStyle {
|
||||
get {
|
||||
if (sortedDescendingHeaderStyle == null) {
|
||||
sortedDescendingHeaderStyle = new TableItemStyle ();
|
||||
if (IsTrackingViewState)
|
||||
((IStateManager)sortedDescendingHeaderStyle).TrackViewState ();
|
||||
}
|
||||
|
||||
return sortedDescendingHeaderStyle;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
public virtual bool IsBindableType (Type type)
|
||||
{
|
||||
return type.IsPrimitive || type == typeof (string) || type == typeof (decimal) || type == typeof (DateTime) || type == typeof (Guid);
|
||||
@@ -1225,7 +1374,19 @@ namespace System.Web.UI.WebControls
|
||||
{
|
||||
return new ContainedTable (this);
|
||||
}
|
||||
|
||||
|
||||
void CreateHeaderRow (Table mainTable, DataControlField[] fields, bool dataBinding)
|
||||
{
|
||||
GridViewRow headerRow = CreateRow (-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
|
||||
InitializeRow (headerRow, fields);
|
||||
OnRowCreated (new GridViewRowEventArgs (headerRow));
|
||||
mainTable.Rows.Add (headerRow);
|
||||
if (dataBinding) {
|
||||
headerRow.DataBind ();
|
||||
OnRowDataBound (new GridViewRowEventArgs (headerRow));
|
||||
}
|
||||
}
|
||||
|
||||
protected override int CreateChildControls (IEnumerable data, bool dataBinding)
|
||||
{
|
||||
// clear GridView
|
||||
@@ -1298,6 +1459,28 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
// Main table creation
|
||||
Table mainTable = ContainedTable;
|
||||
List <DataKey> dataKeyList;
|
||||
string[] dataKeyNames;
|
||||
#if NET_4_0
|
||||
List <DataKey> dataKeySuffixList;
|
||||
string[] clientIDRowSuffix;
|
||||
#endif
|
||||
if (dataBinding) {
|
||||
dataKeyList = DataKeyList;
|
||||
dataKeyNames = DataKeyNames;
|
||||
#if NET_4_0
|
||||
dataKeySuffixList = DataKeySuffixList;
|
||||
clientIDRowSuffix = ClientIDRowSuffix;
|
||||
#endif
|
||||
} else {
|
||||
dataKeyList = null;
|
||||
dataKeyNames = null;
|
||||
#if NET_4_0
|
||||
dataKeySuffixList = null;
|
||||
clientIDRowSuffix = null;
|
||||
#endif
|
||||
}
|
||||
|
||||
while (skip_first || enumerator.MoveNext ()) {
|
||||
skip_first = false;
|
||||
object obj = enumerator.Current;
|
||||
@@ -1315,14 +1498,8 @@ namespace System.Web.UI.WebControls
|
||||
topPagerRow.Visible = false;
|
||||
}
|
||||
|
||||
GridViewRow headerRow = CreateRow (-1, -1, DataControlRowType.Header, DataControlRowState.Normal);
|
||||
InitializeRow (headerRow, fields);
|
||||
OnRowCreated (new GridViewRowEventArgs (headerRow));
|
||||
mainTable.Rows.Add (headerRow);
|
||||
if (dataBinding) {
|
||||
headerRow.DataBind ();
|
||||
OnRowDataBound (new GridViewRowEventArgs (headerRow));
|
||||
}
|
||||
if (ShowHeader)
|
||||
CreateHeaderRow (mainTable, fields, dataBinding);
|
||||
}
|
||||
|
||||
DataControlRowState rstate = GetRowState (list.Count);
|
||||
@@ -1336,12 +1513,20 @@ namespace System.Web.UI.WebControls
|
||||
row.DataBind ();
|
||||
if (EditIndex == row.RowIndex)
|
||||
oldEditValues = new DataKey (GetRowValues (row, true, true));
|
||||
DataKeyArrayList.Add (new DataKey (CreateRowDataKey (row), DataKeyNames));
|
||||
dataKeyList.Add (new DataKey (CreateRowDataKey (row), dataKeyNames));
|
||||
#if NET_4_0
|
||||
dataKeySuffixList.Add (new DataKey (CreateRowSuffixDataKey (row), clientIDRowSuffix));
|
||||
#endif
|
||||
OnRowDataBound (new GridViewRowEventArgs (row));
|
||||
}
|
||||
}
|
||||
|
||||
int retValue;
|
||||
if (list.Count == 0) {
|
||||
#if NET_4_0
|
||||
if (ShowHeader && ShowHeaderWhenEmpty)
|
||||
CreateHeaderRow (mainTable, fields, dataBinding);
|
||||
#endif
|
||||
GridViewRow emptyRow = CreateEmptyrRow (fieldCount);
|
||||
if (emptyRow != null) {
|
||||
OnRowCreated (new GridViewRowEventArgs (emptyRow));
|
||||
@@ -1351,6 +1536,10 @@ namespace System.Web.UI.WebControls
|
||||
OnRowDataBound (new GridViewRowEventArgs (emptyRow));
|
||||
}
|
||||
}
|
||||
#if NET_4_0
|
||||
if (mainTable.Rows.Count == 0)
|
||||
table = null;
|
||||
#endif
|
||||
return 0;
|
||||
} else {
|
||||
GridViewRow footerRow = CreateRow (-1, -1, DataControlRowType.Footer, DataControlRowState.Normal);
|
||||
@@ -1392,6 +1581,7 @@ namespace System.Web.UI.WebControls
|
||||
table = CreateChildTable ();
|
||||
Controls.Add (table);
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
}
|
||||
@@ -1484,25 +1674,45 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
}
|
||||
|
||||
IOrderedDictionary CreateRowDataKey (GridViewRow row)
|
||||
void LoadAndCacheProperties (string[] names, object dataItem, ref PropertyDescriptor[] cache)
|
||||
{
|
||||
if (cachedKeyProperties == null) {
|
||||
PropertyDescriptorCollection props = TypeDescriptor.GetProperties (row.DataItem);
|
||||
cachedKeyProperties = new PropertyDescriptor [DataKeyNames.Length];
|
||||
for (int n=0; n<DataKeyNames.Length; n++) {
|
||||
PropertyDescriptor p = props.Find (DataKeyNames [n], true);
|
||||
if (p == null)
|
||||
throw new InvalidOperationException ("Property '" + DataKeyNames [n] + "' not found in object of type " + row.DataItem.GetType ());
|
||||
cachedKeyProperties [n] = p;
|
||||
}
|
||||
if (cache != null)
|
||||
return;
|
||||
|
||||
PropertyDescriptorCollection props = TypeDescriptor.GetProperties (dataItem);
|
||||
int len = names != null ? names.Length : 0;
|
||||
cache = new PropertyDescriptor [len];
|
||||
for (int n = 0; n < len; n++) {
|
||||
string propName = names [n];
|
||||
PropertyDescriptor p = props.Find (propName, true);
|
||||
if (p == null)
|
||||
throw new InvalidOperationException ("Property '" + propName + "' not found in object of type " + dataItem.GetType ());
|
||||
cache [n] = p;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
IOrderedDictionary CreateDictionaryFromProperties (PropertyDescriptor[] cache, object dataItem)
|
||||
{
|
||||
OrderedDictionary dic = new OrderedDictionary ();
|
||||
foreach (PropertyDescriptor p in cachedKeyProperties)
|
||||
dic [p.Name] = p.GetValue (row.DataItem);
|
||||
foreach (PropertyDescriptor p in cache)
|
||||
dic [p.Name] = p.GetValue (dataItem);
|
||||
return dic;
|
||||
}
|
||||
|
||||
IOrderedDictionary CreateRowDataKey (GridViewRow row)
|
||||
{
|
||||
object dataItem = row.DataItem;
|
||||
LoadAndCacheProperties (DataKeyNames, dataItem, ref cachedKeyProperties);
|
||||
return CreateDictionaryFromProperties (cachedKeyProperties, dataItem);
|
||||
}
|
||||
#if NET_4_0
|
||||
IOrderedDictionary CreateRowSuffixDataKey (GridViewRow row)
|
||||
{
|
||||
object dataItem = row.DataItem;
|
||||
LoadAndCacheProperties (ClientIDRowSuffix, dataItem, ref cachedSuffixKeyProperties);
|
||||
return CreateDictionaryFromProperties (cachedSuffixKeyProperties, dataItem);
|
||||
}
|
||||
#endif
|
||||
IOrderedDictionary GetRowValues (GridViewRow row, bool includeReadOnlyFields, bool includePrimaryKey)
|
||||
{
|
||||
OrderedDictionary dic = new OrderedDictionary ();
|
||||
@@ -1540,11 +1750,11 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
public sealed override void DataBind ()
|
||||
{
|
||||
DataKeyArrayList.Clear ();
|
||||
DataKeyList.Clear ();
|
||||
cachedKeyProperties = null;
|
||||
base.DataBind ();
|
||||
|
||||
keys = new DataKeyArray (DataKeyArrayList);
|
||||
keys = new DataKeyArray (DataKeyList);
|
||||
|
||||
GridViewRow row = HeaderRow;
|
||||
if (row != null)
|
||||
@@ -1602,7 +1812,10 @@ namespace System.Web.UI.WebControls
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
string sortExpression = SortExpression;
|
||||
bool haveSorting = !String.IsNullOrEmpty (sortExpression);
|
||||
#endif
|
||||
foreach (TableCell cell in row.Cells) {
|
||||
DataControlFieldCell fcell = cell as DataControlFieldCell;
|
||||
if (fcell != null) {
|
||||
@@ -1618,6 +1831,10 @@ namespace System.Web.UI.WebControls
|
||||
case DataControlRowType.Header:
|
||||
if (field.HeaderStyleCreated && !field.HeaderStyle.IsEmpty)
|
||||
cell.ControlStyle.MergeWith (field.HeaderStyle);
|
||||
#if NET_4_0
|
||||
if (haveSorting)
|
||||
MergeWithSortingStyle (sortExpression, sortedAscendingHeaderStyle, sortedDescendingHeaderStyle, field, cell);
|
||||
#endif
|
||||
break;
|
||||
case DataControlRowType.Footer:
|
||||
if (field.FooterStyleCreated && !field.FooterStyle.IsEmpty)
|
||||
@@ -1633,13 +1850,25 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
if (field.ItemStyleCreated && !field.ItemStyle.IsEmpty)
|
||||
cell.ControlStyle.MergeWith (field.ItemStyle);
|
||||
#if NET_4_0
|
||||
if (haveSorting)
|
||||
MergeWithSortingStyle (sortExpression, sortedAscendingCellStyle, sortedDescendingCellStyle, field, cell);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
void MergeWithSortingStyle (string sortExpression, TableItemStyle ascending, TableItemStyle descending, DataControlField field, TableCell cell)
|
||||
{
|
||||
if (String.Compare (field.SortExpression, sortExpression, StringComparison.OrdinalIgnoreCase) != 0)
|
||||
return;
|
||||
|
||||
cell.ControlStyle.MergeWith (SortDirection == SortDirection.Ascending ? ascending : descending);
|
||||
}
|
||||
#endif
|
||||
protected internal override void OnInit (EventArgs e)
|
||||
{
|
||||
Page page = Page;
|
||||
@@ -1732,25 +1961,25 @@ namespace System.Web.UI.WebControls
|
||||
newIndex = paramIndex - 1;
|
||||
break;
|
||||
}
|
||||
ShowPage (newIndex);
|
||||
SetPageIndex (newIndex);
|
||||
break;
|
||||
|
||||
case DataControlCommands.FirstPageCommandArgument:
|
||||
ShowPage (0);
|
||||
SetPageIndex (0);
|
||||
break;
|
||||
|
||||
case DataControlCommands.LastPageCommandArgument:
|
||||
ShowPage (PageCount - 1);
|
||||
SetPageIndex (PageCount - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.NextPageCommandArgument:
|
||||
if (PageIndex < PageCount - 1)
|
||||
ShowPage (PageIndex + 1);
|
||||
SetPageIndex (PageIndex + 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.PreviousPageCommandArgument:
|
||||
if (PageIndex > 0)
|
||||
ShowPage (PageIndex - 1);
|
||||
SetPageIndex (PageIndex - 1);
|
||||
break;
|
||||
|
||||
case DataControlCommands.SelectCommandName:
|
||||
@@ -1758,7 +1987,7 @@ namespace System.Web.UI.WebControls
|
||||
break;
|
||||
|
||||
case DataControlCommands.EditCommandName:
|
||||
EditRow (int.Parse (param));
|
||||
SetEditRow (int.Parse (param));
|
||||
break;
|
||||
|
||||
case DataControlCommands.UpdateCommandName:
|
||||
@@ -1805,7 +2034,9 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
OnSorted (EventArgs.Empty);
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public
|
||||
#endif
|
||||
void SelectRow (int index)
|
||||
{
|
||||
GridViewSelectEventArgs args = new GridViewSelectEventArgs (index);
|
||||
@@ -1816,8 +2047,10 @@ namespace System.Web.UI.WebControls
|
||||
OnSelectedIndexChanged (EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
void ShowPage (int newIndex)
|
||||
#if NET_4_0
|
||||
public
|
||||
#endif
|
||||
void SetPageIndex (int newIndex)
|
||||
{
|
||||
GridViewPageEventArgs args = new GridViewPageEventArgs (newIndex);
|
||||
OnPageIndexChanging (args);
|
||||
@@ -1829,8 +2062,10 @@ namespace System.Web.UI.WebControls
|
||||
PageIndex = args.NewPageIndex;
|
||||
OnPageIndexChanged (EventArgs.Empty);
|
||||
}
|
||||
|
||||
void EditRow (int index)
|
||||
#if NET_4_0
|
||||
public
|
||||
#endif
|
||||
void SetEditRow (int index)
|
||||
{
|
||||
GridViewEditEventArgs args = new GridViewEditEventArgs (index);
|
||||
OnRowEditing (args);
|
||||
@@ -1942,7 +2177,8 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
protected internal override void LoadControlState (object ob)
|
||||
{
|
||||
if (ob == null) return;
|
||||
if (ob == null)
|
||||
return;
|
||||
object[] state = (object[]) ob;
|
||||
base.LoadControlState (state[0]);
|
||||
pageIndex = (int) state[1];
|
||||
@@ -1952,10 +2188,16 @@ namespace System.Web.UI.WebControls
|
||||
sortDirection = (SortDirection) state[5];
|
||||
DataKeyNames = (string []) state [6];
|
||||
if (state [7] != null)
|
||||
LoadDataKeyArrayState ((object []) state [7]);
|
||||
LoadDataKeyArrayState ((object []) state [7], out keys);
|
||||
if (state [8] != null)
|
||||
((IStateManager) OldEditValues).LoadViewState (state [8]);
|
||||
pageCount = (int)state [9];
|
||||
#if NET_4_0
|
||||
if (state [10] != null)
|
||||
ClientIDRowSuffix = (string[]) state [10];
|
||||
if (state [11] != null)
|
||||
LoadDataKeyArrayState ((object []) state [11], out rowSuffixKeys);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected internal override object SaveControlState ()
|
||||
@@ -1980,13 +2222,17 @@ namespace System.Web.UI.WebControls
|
||||
sortExpression,
|
||||
sortDirection,
|
||||
DataKeyNames,
|
||||
SaveDataKeyArrayState (),
|
||||
SaveDataKeyArrayState (keys),
|
||||
(oldEditValues == null ? null : ((IStateManager)oldEditValues).SaveViewState ()),
|
||||
pageCount
|
||||
pageCount,
|
||||
#if NET_4_0
|
||||
ClientIDRowSuffix,
|
||||
SaveDataKeyArrayState (rowSuffixKeys)
|
||||
#endif
|
||||
};
|
||||
}
|
||||
|
||||
object [] SaveDataKeyArrayState ()
|
||||
object [] SaveDataKeyArrayState (DataKeyArray keys)
|
||||
{
|
||||
if (keys == null)
|
||||
return null;
|
||||
@@ -1997,14 +2243,18 @@ namespace System.Web.UI.WebControls
|
||||
return state;
|
||||
}
|
||||
|
||||
void LoadDataKeyArrayState (object [] state)
|
||||
void LoadDataKeyArrayState (object [] state, out DataKeyArray keys)
|
||||
{
|
||||
List <DataKey> dataKeyList = DataKeyList;
|
||||
string[] dataKeyNames = DataKeyNames;
|
||||
int dataKeyNamesLen = dataKeyNames.Length;
|
||||
|
||||
for (int i = 0; i < state.Length; i++) {
|
||||
DataKey dataKey = new DataKey (new OrderedDictionary (DataKeyNames.Length), DataKeyNames);
|
||||
DataKey dataKey = new DataKey (new OrderedDictionary (dataKeyNamesLen), dataKeyNames);
|
||||
((IStateManager) dataKey).LoadViewState (state [i]);
|
||||
DataKeyArrayList.Add (dataKey);
|
||||
dataKeyList.Add (dataKey);
|
||||
}
|
||||
keys = new DataKeyArray (DataKeyArrayList);
|
||||
keys = new DataKeyArray (dataKeyList);
|
||||
}
|
||||
|
||||
protected override void TrackViewState ()
|
||||
@@ -2030,6 +2280,21 @@ namespace System.Web.UI.WebControls
|
||||
((IStateManager)editRowStyle).TrackViewState();
|
||||
if (emptyDataRowStyle != null)
|
||||
((IStateManager)emptyDataRowStyle).TrackViewState();
|
||||
#if NET_4_0
|
||||
if (sortedAscendingCellStyle != null)
|
||||
((IStateManager)sortedAscendingCellStyle).TrackViewState ();
|
||||
|
||||
if (sortedAscendingHeaderStyle != null)
|
||||
((IStateManager)sortedAscendingHeaderStyle).TrackViewState ();
|
||||
|
||||
if (sortedDescendingCellStyle != null)
|
||||
((IStateManager)sortedDescendingCellStyle).TrackViewState ();
|
||||
|
||||
if (sortedDescendingHeaderStyle != null)
|
||||
((IStateManager)sortedDescendingHeaderStyle).TrackViewState ();
|
||||
if (rowSuffixKeys != null)
|
||||
((IStateManager) rowSuffixKeys).TrackViewState ();
|
||||
#endif
|
||||
if (keys != null)
|
||||
((IStateManager)keys).TrackViewState();
|
||||
if (autoFieldProperties != null) {
|
||||
@@ -2040,28 +2305,40 @@ namespace System.Web.UI.WebControls
|
||||
|
||||
protected override object SaveViewState ()
|
||||
{
|
||||
object[] states = new object [12];
|
||||
states[0] = base.SaveViewState();
|
||||
states[1] = (columns == null ? null : ((IStateManager)columns).SaveViewState());
|
||||
states[2] = (pagerSettings == null ? null : ((IStateManager)pagerSettings).SaveViewState());
|
||||
states[3] = (alternatingRowStyle == null ? null : ((IStateManager)alternatingRowStyle).SaveViewState());
|
||||
states[4] = (footerStyle == null ? null : ((IStateManager)footerStyle).SaveViewState());
|
||||
states[5] = (headerStyle == null ? null : ((IStateManager)headerStyle).SaveViewState());
|
||||
states[6] = (pagerStyle == null ? null : ((IStateManager)pagerStyle).SaveViewState());
|
||||
states[7] = (rowStyle == null ? null : ((IStateManager)rowStyle).SaveViewState());
|
||||
states[8] = (selectedRowStyle == null ? null : ((IStateManager)selectedRowStyle).SaveViewState());
|
||||
states[9] = (editRowStyle == null ? null : ((IStateManager)editRowStyle).SaveViewState());
|
||||
states[10] = (emptyDataRowStyle == null ? null : ((IStateManager)emptyDataRowStyle).SaveViewState());
|
||||
object[] autoFieldsData = null;
|
||||
|
||||
if (autoFieldProperties != null) {
|
||||
object[] data = new object [autoFieldProperties.Length];
|
||||
bool allNull = true;
|
||||
for (int n=0; n<data.Length; n++) {
|
||||
for (int n = 0; n < data.Length; n++) {
|
||||
data [n] = ((IStateManager)autoFieldProperties [n]).SaveViewState ();
|
||||
if (data [n] != null) allNull = false;
|
||||
if (data [n] != null)
|
||||
allNull = false;
|
||||
}
|
||||
if (!allNull) states [11] = data;
|
||||
if (!allNull)
|
||||
autoFieldsData = data;
|
||||
}
|
||||
|
||||
object[] states = {
|
||||
base.SaveViewState(), // 0
|
||||
(columns == null ? null : ((IStateManager)columns).SaveViewState()), // 1
|
||||
(pagerSettings == null ? null : ((IStateManager)pagerSettings).SaveViewState()), // 2
|
||||
(alternatingRowStyle == null ? null : ((IStateManager)alternatingRowStyle).SaveViewState()), // 3
|
||||
(footerStyle == null ? null : ((IStateManager)footerStyle).SaveViewState()), // 4
|
||||
(headerStyle == null ? null : ((IStateManager)headerStyle).SaveViewState()), // 5
|
||||
(pagerStyle == null ? null : ((IStateManager)pagerStyle).SaveViewState()), // 6
|
||||
(rowStyle == null ? null : ((IStateManager)rowStyle).SaveViewState()), // 7
|
||||
(selectedRowStyle == null ? null : ((IStateManager)selectedRowStyle).SaveViewState()), // 8
|
||||
(editRowStyle == null ? null : ((IStateManager)editRowStyle).SaveViewState()), // 9
|
||||
(emptyDataRowStyle == null ? null : ((IStateManager)emptyDataRowStyle).SaveViewState()), // 10
|
||||
autoFieldsData, // 11
|
||||
#if NET_4_0
|
||||
sortedAscendingCellStyle == null ? null : ((IStateManager)sortedAscendingCellStyle).SaveViewState (), // 12
|
||||
sortedAscendingHeaderStyle == null ? null : ((IStateManager)sortedAscendingHeaderStyle).SaveViewState (), // 13
|
||||
sortedDescendingCellStyle == null ? null : ((IStateManager)sortedDescendingCellStyle).SaveViewState (), // 14
|
||||
sortedDescendingHeaderStyle == null ? null : ((IStateManager)sortedDescendingHeaderStyle).SaveViewState () // 15
|
||||
#endif
|
||||
};
|
||||
|
||||
for (int i = states.Length - 1; i >= 0; i--) {
|
||||
if (states [i] != null)
|
||||
@@ -2113,6 +2390,16 @@ namespace System.Web.UI.WebControls
|
||||
((IStateManager)EditRowStyle).LoadViewState (states[9]);
|
||||
if (states[10] != null)
|
||||
((IStateManager)EmptyDataRowStyle).LoadViewState (states[10]);
|
||||
#if NET_4_0
|
||||
if (states [12] != null)
|
||||
((IStateManager)sortedAscendingCellStyle).LoadViewState (states [12]);
|
||||
if (states [13] != null)
|
||||
((IStateManager)sortedAscendingHeaderStyle).LoadViewState (states [13]);
|
||||
if (states [14] != null)
|
||||
((IStateManager)sortedDescendingCellStyle).LoadViewState (states [14]);
|
||||
if (states [15] != null)
|
||||
((IStateManager)sortedDescendingHeaderStyle).LoadViewState (states [15]);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
|
||||
|
||||
@@ -166,5 +166,10 @@ namespace System.Web.UI.WebControls
|
||||
Controls.Clear ();
|
||||
}
|
||||
}
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,11 @@ namespace System.Web.UI.WebControls
|
||||
}
|
||||
set { ViewState ["GenerateEmptyAlternateText"] = value; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override void AddAttributesToRender (HtmlTextWriter writer)
|
||||
{
|
||||
base.AddAttributesToRender (writer);
|
||||
@@ -189,20 +193,12 @@ namespace System.Web.UI.WebControls
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Align, "texttop", false);
|
||||
break;
|
||||
}
|
||||
#if NET_2_0
|
||||
#if BUG_78875_FIXED
|
||||
if (Context.Request.Browser.SupportsCss)
|
||||
#endif
|
||||
#if !NET_4_0
|
||||
if (BorderWidth.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
|
||||
#if BUG_78875_FIXED
|
||||
else
|
||||
#endif
|
||||
#else
|
||||
// if border-with is not specified in style or
|
||||
// no style is defined - set image to no border
|
||||
if (!ControlStyleCreated || ControlStyle.BorderWidth.IsEmpty)
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,11 @@ namespace System.Web.UI.WebControls
|
||||
get { return AlternateText; }
|
||||
set { AlternateText = value; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override void AddAttributesToRender (HtmlTextWriter writer)
|
||||
{
|
||||
Page page = Page;
|
||||
|
||||
@@ -72,7 +72,11 @@ namespace System.Web.UI.WebControls
|
||||
get { return ViewState.GetString ("AssociatedControlID", String.Empty); }
|
||||
set { ViewState ["AssociatedControlID"] = value; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override void LoadViewState (object savedState)
|
||||
{
|
||||
base.LoadViewState (savedState);
|
||||
|
||||
@@ -263,6 +263,11 @@ namespace System.Web.UI.WebControls
|
||||
get { return ViewState.GetString ("ValidationGroup", String.Empty); }
|
||||
set { ViewState ["ValidationGroup"] = value; }
|
||||
}
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,8 +60,11 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["FormatString"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected internal override void Render (HtmlTextWriter writer)
|
||||
{
|
||||
if (!Anonymous) {
|
||||
|
||||
@@ -260,8 +260,13 @@ namespace System.Web.UI.WebControls
|
||||
public Unit StaticSubMenuIndent {
|
||||
get {
|
||||
object o = ViewState ["StaticSubMenuIndent"];
|
||||
if (o != null) return (Unit)o;
|
||||
if (o != null)
|
||||
return (Unit)o;
|
||||
#if NET_4_0
|
||||
return Unit.Empty;
|
||||
#else
|
||||
return new Unit (16);
|
||||
#endif
|
||||
}
|
||||
set {
|
||||
ViewState["StaticSubMenuIndent"] = value;
|
||||
|
||||
@@ -41,7 +41,9 @@ namespace System.Web.UI.WebControls {
|
||||
[Designer ("System.Web.UI.Design.WebControls.PanelDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
|
||||
[ParseChildren (false)]
|
||||
[PersistChildren (true)]
|
||||
#if !NET_4_0
|
||||
[ToolboxData ("<{0}:Panel runat=server>Panel</{0}:Panel>")]
|
||||
#endif
|
||||
public class Panel : WebControl {
|
||||
|
||||
public Panel () : base (HtmlTextWriterTag.Div)
|
||||
@@ -118,56 +120,15 @@ namespace System.Web.UI.WebControls {
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Align, align);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !NET_2_0
|
||||
[Bindable(true)]
|
||||
[DefaultValue("")]
|
||||
[Editor("System.Web.UI.Design.ImageUrlEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
|
||||
[WebSysDescription ("")]
|
||||
[WebCategory ("Appearance")]
|
||||
public virtual string BackImageUrl {
|
||||
get {
|
||||
return ViewState.GetString ("BackImageUrl", "");
|
||||
}
|
||||
|
||||
set {
|
||||
ViewState ["BackImageUrl"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
[DefaultValue(HorizontalAlign.NotSet)]
|
||||
[WebSysDescription ("")]
|
||||
[WebCategory ("Layout")]
|
||||
public virtual HorizontalAlign HorizontalAlign {
|
||||
get {
|
||||
return (HorizontalAlign) ViewState.GetInt ("HorizontalAlign", (int) HorizontalAlign.NotSet);
|
||||
}
|
||||
set {
|
||||
ViewState ["HorizontalAlign"] = (int) value;
|
||||
}
|
||||
}
|
||||
|
||||
[Bindable(true)]
|
||||
[DefaultValue(true)]
|
||||
[WebSysDescription ("")]
|
||||
[WebCategory ("Layout")]
|
||||
public virtual bool Wrap {
|
||||
get {
|
||||
return ViewState.GetBool ("Wrap", true);
|
||||
}
|
||||
set {
|
||||
ViewState ["Wrap"] = value;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_2_0
|
||||
PanelStyle PanelStyle {
|
||||
get { return (ControlStyle as PanelStyle); }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[UrlProperty]
|
||||
#else
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
[DefaultValue ("")]
|
||||
[Editor ("System.Web.UI.Design.ImageUrlEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
|
||||
[WebSysDescription ("")]
|
||||
@@ -189,8 +150,9 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["BackImageUrl"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if !NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
[DefaultValue (HorizontalAlign.NotSet)]
|
||||
[WebSysDescription ("")]
|
||||
[WebCategory ("Layout")]
|
||||
@@ -211,8 +173,9 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["HorizontalAlign"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if !NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
[DefaultValue (true)]
|
||||
[WebSysDescription ("")]
|
||||
[WebCategory ("Layout")]
|
||||
@@ -235,6 +198,9 @@ namespace System.Web.UI.WebControls {
|
||||
}
|
||||
|
||||
[ThemeableAttribute (false)]
|
||||
#if NET_4_0
|
||||
[DefaultValue ("")]
|
||||
#endif
|
||||
public virtual string DefaultButton {
|
||||
get {
|
||||
return ViewState.GetString ("DefaultButton", String.Empty);
|
||||
@@ -243,7 +209,9 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["DefaultButton"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[DefaultValue (ContentDirection.NotSet)]
|
||||
#endif
|
||||
public virtual ContentDirection Direction {
|
||||
get {
|
||||
if (ControlStyleCreated) {
|
||||
@@ -263,6 +231,9 @@ namespace System.Web.UI.WebControls {
|
||||
}
|
||||
|
||||
[LocalizableAttribute (true)]
|
||||
#if NET_4_0
|
||||
[DefaultValue ("")]
|
||||
#endif
|
||||
public virtual string GroupingText {
|
||||
get {
|
||||
return ViewState.GetString ("GroupingText", String.Empty);
|
||||
@@ -271,7 +242,9 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["GroupingText"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[DefaultValue (ScrollBars.None)]
|
||||
#endif
|
||||
public virtual ScrollBars ScrollBars {
|
||||
get {
|
||||
if (ControlStyleCreated) {
|
||||
@@ -289,7 +262,11 @@ namespace System.Web.UI.WebControls {
|
||||
ViewState ["ScrollBars"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override Style CreateControlStyle ()
|
||||
{
|
||||
return new PanelStyle (ViewState);
|
||||
|
||||
@@ -402,10 +402,9 @@ namespace System.Web.UI.WebControls
|
||||
if (PathSeparatorTemplate != null) {
|
||||
item.ApplyStyle (PathSeparatorStyle);
|
||||
PathSeparatorTemplate.InstantiateIn (item);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Literal h = new Literal ();
|
||||
h.Text = PathSeparator;
|
||||
h.Text = HttpUtility.HtmlEncode (PathSeparator);
|
||||
item.ApplyStyle (PathSeparatorStyle);
|
||||
item.Controls.Add (h);
|
||||
}
|
||||
@@ -461,28 +460,32 @@ namespace System.Web.UI.WebControls
|
||||
protected internal override void RenderContents (HtmlTextWriter w)
|
||||
{
|
||||
string skip_id = ClientID + "_SkipLink";
|
||||
string altText = SkipLinkText;
|
||||
bool needAnchor = !String.IsNullOrEmpty (altText);
|
||||
|
||||
if (needAnchor) {
|
||||
// Anchor start
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Href, "#" + skip_id);
|
||||
w.RenderBeginTag (HtmlTextWriterTag.A);
|
||||
|
||||
if (SkipLinkText != "") {
|
||||
HtmlAnchor anchor = new HtmlAnchor ();
|
||||
anchor.HRef = "#" + skip_id;
|
||||
// Image
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Alt, altText);
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Height, "0");
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Width, "0");
|
||||
w.AddAttribute (HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif"));
|
||||
w.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, "0px");
|
||||
w.RenderBeginTag (HtmlTextWriterTag.Img);
|
||||
w.RenderEndTag ();
|
||||
|
||||
Image img = new Image ();
|
||||
img.ImageUrl = Page.ClientScript.GetWebResourceUrl (typeof (SiteMapPath), "transparent.gif");
|
||||
img.Attributes.Add ("height", "0");
|
||||
img.Attributes.Add ("width", "0");
|
||||
img.AlternateText = SkipLinkText;
|
||||
|
||||
anchor.Controls.Add (img);
|
||||
|
||||
anchor.Render (w);
|
||||
w.RenderEndTag ();
|
||||
}
|
||||
|
||||
base.RenderContents (w);
|
||||
|
||||
if (SkipLinkText != "") {
|
||||
HtmlAnchor anchor = new HtmlAnchor ();
|
||||
anchor.ID = skip_id;
|
||||
anchor.Render (w);
|
||||
if (needAnchor) {
|
||||
w.AddAttribute(HtmlTextWriterAttribute.Id, skip_id);
|
||||
w.RenderBeginTag(HtmlTextWriterTag.A);
|
||||
w.RenderEndTag();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -433,105 +433,6 @@ namespace System.Web.UI.WebControls {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if ONLY_1_1
|
||||
void WriteStyleAttributes (HtmlTextWriter writer)
|
||||
{
|
||||
string s;
|
||||
Color color;
|
||||
BorderStyle bs;
|
||||
Unit u;
|
||||
|
||||
if (CheckBit ((int) Styles.BackColor)) {
|
||||
color = (Color)viewstate["BackColor"];
|
||||
if (!color.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BackgroundColor, ColorTranslator.ToHtml(color));
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Styles.BorderColor)) {
|
||||
color = (Color)viewstate["BorderColor"];
|
||||
if (!color.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderColor, ColorTranslator.ToHtml(color));
|
||||
}
|
||||
|
||||
bool have_width = false;
|
||||
if (CheckBit ((int) Styles.BorderWidth)) {
|
||||
u = (Unit)viewstate["BorderWidth"];
|
||||
if (!u.IsEmpty) {
|
||||
if (u.Value > 0)
|
||||
have_width = true;
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderWidth, u.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Styles.BorderStyle)) {
|
||||
bs = (BorderStyle)viewstate["BorderStyle"];
|
||||
if (bs != BorderStyle.NotSet)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderStyle, bs.ToString());
|
||||
else {
|
||||
if (CheckBit ((int) Styles.BorderWidth))
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderStyle, "solid");
|
||||
}
|
||||
} else if (have_width) {
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.BorderStyle, "solid");
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Styles.ForeColor)) {
|
||||
color = (Color)viewstate["ForeColor"];
|
||||
if (!color.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.Color, ColorTranslator.ToHtml(color));
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Styles.Height)) {
|
||||
u = (Unit)viewstate["Height"];
|
||||
if (!u.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.Height, u.ToString());
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Styles.Width)) {
|
||||
u = (Unit)viewstate["Width"];
|
||||
if (!u.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.Width, u.ToString());
|
||||
}
|
||||
|
||||
if (CheckBit ((int) Style.Styles.FontAll)) {
|
||||
// Fonts are a bit weird
|
||||
FontInfo font = Font;
|
||||
if (font.Name != string.Empty) {
|
||||
s = font.Names[0];
|
||||
for (int i = 1; i < font.Names.Length; i++)
|
||||
s += "," + font.Names[i];
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.FontFamily, s);
|
||||
}
|
||||
|
||||
if (font.Bold)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.FontWeight, "bold");
|
||||
|
||||
if (font.Italic)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.FontStyle, "italic");
|
||||
|
||||
if (!font.Size.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.FontSize, font.Size.ToString());
|
||||
|
||||
// These styles are munged into a attribute decoration
|
||||
s = string.Empty;
|
||||
|
||||
if (font.Overline)
|
||||
s += "overline ";
|
||||
|
||||
if (font.Strikeout)
|
||||
s += "line-through ";
|
||||
|
||||
if (font.Underline)
|
||||
s += "underline ";
|
||||
|
||||
s = (s != "") ? s : AlwaysRenderTextDecoration ? "none" : "";
|
||||
if (s != "")
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.TextDecoration, s);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_2_0
|
||||
protected virtual void FillStyleAttributes (CssStyleCollection attributes, IUrlResolutionService urlResolver)
|
||||
{
|
||||
@@ -856,15 +757,29 @@ namespace System.Web.UI.WebControls {
|
||||
fontinfo = null;
|
||||
}
|
||||
|
||||
internal void AddCssClass (string cssClass) {
|
||||
internal void AddCssClass (string cssClass)
|
||||
{
|
||||
if (String.IsNullOrEmpty (cssClass))
|
||||
return;
|
||||
|
||||
if (CssClass.Length > 0)
|
||||
CssClass += " ";
|
||||
CssClass += cssClass;
|
||||
string newClass = CssClass;
|
||||
if (newClass.Length > 0)
|
||||
newClass += " ";
|
||||
newClass += cssClass;
|
||||
CssClass = newClass;
|
||||
}
|
||||
#if NET_4_0
|
||||
internal void PrependCssClass (string cssClass)
|
||||
{
|
||||
if (String.IsNullOrEmpty (cssClass))
|
||||
return;
|
||||
|
||||
string oldClass = CssClass;
|
||||
if (oldClass.Length > 0)
|
||||
cssClass += " ";
|
||||
CssClass = cssClass + oldClass;
|
||||
}
|
||||
#endif
|
||||
public void SetDirty ()
|
||||
{
|
||||
if (viewstate != null)
|
||||
|
||||
@@ -190,16 +190,21 @@ namespace System.Web.UI.WebControls {
|
||||
private TableStyle TableStyle {
|
||||
get { return (ControlStyle as TableStyle); }
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override void AddAttributesToRender (HtmlTextWriter writer)
|
||||
{
|
||||
base.AddAttributesToRender (writer);
|
||||
#if !NET_4_0
|
||||
if (!ControlStyleCreated || TableStyle.IsEmpty) {
|
||||
// for some reason border=X seems to be always present
|
||||
// and isn't rendered as a style attribute
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Border, "0", false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
protected override ControlCollection CreateControlCollection ()
|
||||
@@ -287,9 +292,12 @@ namespace System.Web.UI.WebControls {
|
||||
writer.RenderBeginTag (HtmlTextWriterTag.Caption);
|
||||
writer.Write (s);
|
||||
writer.RenderEndTag ();
|
||||
} else if (HasControls ()) {
|
||||
writer.Indent++;
|
||||
}
|
||||
// #if !NET_4_0
|
||||
// else if (HasControls ()) {
|
||||
// writer.Indent++;
|
||||
// }
|
||||
// #endif
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -189,7 +189,11 @@ namespace System.Web.UI.WebControls {
|
||||
}
|
||||
set { TableItemStyle.Wrap = value; }
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
TableItemStyle TableItemStyle {
|
||||
get { return (ControlStyle as TableItemStyle); }
|
||||
}
|
||||
|
||||
@@ -108,8 +108,11 @@ namespace System.Web.UI.WebControls {
|
||||
TableItemStyle TableItemStyle {
|
||||
get { return (ControlStyle as TableItemStyle); }
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
public override bool SupportsDisabledAttribute {
|
||||
get { return RenderingCompatibilityLessThan40; }
|
||||
}
|
||||
#endif
|
||||
protected override ControlCollection CreateControlCollection ()
|
||||
{
|
||||
return new CellControlCollection (this);
|
||||
|
||||
@@ -175,8 +175,9 @@ namespace System.Web.UI.WebControls {
|
||||
SetBit ((int) TableStyles.HorizontalAlign);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if NET_4_0
|
||||
[MonoTODO ("collapse style should be rendered only for browsers which support that.")]
|
||||
#endif
|
||||
public override void AddAttributesToRender (HtmlTextWriter writer, WebControl owner)
|
||||
{
|
||||
base.AddAttributesToRender (writer, owner);
|
||||
@@ -191,9 +192,8 @@ namespace System.Web.UI.WebControls {
|
||||
i = CellSpacing;
|
||||
if (i != -1) {
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, i.ToString (Helpers.InvariantCulture), false);
|
||||
if (i == 0) {
|
||||
if (i == 0)
|
||||
writer.AddStyleAttribute(HtmlTextWriterStyle.BorderCollapse, "collapse");
|
||||
}
|
||||
}
|
||||
|
||||
GridLines g = GridLines;
|
||||
@@ -224,7 +224,10 @@ namespace System.Web.UI.WebControls {
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Align, "justify", false);
|
||||
break;
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
if (g != GridLines.None && BorderWidth.IsEmpty)
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Border, "1", false);
|
||||
#else
|
||||
// border (=0) is always present (and base class doesn't seems to add it)
|
||||
// but border is "promoted" to 1 if gridlines are present (with BorderWidth == 0)
|
||||
if (g == GridLines.None) {
|
||||
@@ -234,7 +237,7 @@ namespace System.Web.UI.WebControls {
|
||||
} else {
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Border, BorderWidth.Value.ToString (Helpers.InvariantCulture));
|
||||
}
|
||||
|
||||
#endif
|
||||
#if !NET_2_0
|
||||
string s = BackImageUrl;
|
||||
if (s.Length > 0) {
|
||||
|
||||
@@ -209,8 +209,13 @@ namespace System.Web.UI.WebControls {
|
||||
{
|
||||
// Why didn't msft just override RenderContents!?
|
||||
RenderBeginTag (w);
|
||||
if (TextMode == TextBoxMode.MultiLine)
|
||||
if (TextMode == TextBoxMode.MultiLine) {
|
||||
#if NET_4_0
|
||||
w.WriteLine ();
|
||||
#endif
|
||||
HttpUtility.HtmlEncode (Text, w);
|
||||
}
|
||||
|
||||
RenderEndTag (w);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,11 @@ namespace System.Web.UI.WebControls {
|
||||
#else
|
||||
[PersistChildrenAttribute (false)]
|
||||
#endif
|
||||
public class WebControl : Control, IAttributeAccessor {
|
||||
public class WebControl : Control, IAttributeAccessor
|
||||
{
|
||||
#if NET_4_0
|
||||
const string DEFAULT_DISABLED_CSS_CLASS = "aspNetDisabled";
|
||||
#endif
|
||||
Style style;
|
||||
HtmlTextWriterTag tag;
|
||||
string tag_name;
|
||||
@@ -49,7 +53,12 @@ namespace System.Web.UI.WebControls {
|
||||
StateBag attribute_state;
|
||||
bool enabled;
|
||||
bool track_enabled_state;
|
||||
|
||||
#if NET_4_0
|
||||
static WebControl ()
|
||||
{
|
||||
DisabledCssClass = DEFAULT_DISABLED_CSS_CLASS;
|
||||
}
|
||||
#endif
|
||||
public WebControl (HtmlTextWriterTag tag)
|
||||
{
|
||||
this.tag = tag;
|
||||
@@ -424,7 +433,17 @@ namespace System.Web.UI.WebControls {
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public static string DisabledCssClass {
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Browsable (false)]
|
||||
public virtual bool SupportsDisabledAttribute {
|
||||
get { return true; }
|
||||
}
|
||||
#endif
|
||||
public void ApplyStyle (Style s)
|
||||
{
|
||||
if (s != null && !s.IsEmpty)
|
||||
@@ -506,24 +525,38 @@ namespace System.Web.UI.WebControls {
|
||||
return;
|
||||
|
||||
if (!ControlStyle.BorderWidth.IsEmpty ||
|
||||
(ControlStyle.BorderStyle != BorderStyle.None && ControlStyle.BorderStyle != BorderStyle.NotSet) ||
|
||||
!ControlStyle.Height.IsEmpty ||
|
||||
!ControlStyle.Width.IsEmpty)
|
||||
(ControlStyle.BorderStyle != BorderStyle.None && ControlStyle.BorderStyle != BorderStyle.NotSet) ||
|
||||
!ControlStyle.Height.IsEmpty ||
|
||||
!ControlStyle.Width.IsEmpty)
|
||||
writer.AddStyleAttribute (HtmlTextWriterStyle.Display, "inline-block");
|
||||
}
|
||||
#endif
|
||||
void RenderDisabled (HtmlTextWriter writer)
|
||||
{
|
||||
if (!IsEnabled) {
|
||||
#if NET_4_0
|
||||
if (!SupportsDisabledAttribute)
|
||||
ControlStyle.PrependCssClass (DisabledCssClass);
|
||||
else
|
||||
#endif
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected virtual void AddAttributesToRender (HtmlTextWriter writer)
|
||||
{
|
||||
#if NET_4_0
|
||||
RenderDisabled (writer);
|
||||
#endif
|
||||
if (ID != null)
|
||||
writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID);
|
||||
|
||||
#if !NET_4_0
|
||||
RenderDisabled (writer);
|
||||
#endif
|
||||
if (AccessKey != string.Empty)
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
|
||||
|
||||
if (!IsEnabled)
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
|
||||
|
||||
|
||||
if (ToolTip != string.Empty)
|
||||
writer.AddAttribute (HtmlTextWriterAttribute.Title, ToolTip);
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
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-06-17 Marek Habersack <[email protected]>
|
||||
|
||||
* RootBuilder.cs: both LINK and META HTML tags must be represented
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2002,2003 Ximian, Inc. (http://www.ximian.com)
|
||||
// Copyright (C) 2003-2010 Novell, Inc (http://www.novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
using System;
|
||||
|
||||
namespace System.Web.UI
|
||||
{
|
||||
public enum ClientIDMode
|
||||
{
|
||||
Inherit,
|
||||
AutoID,
|
||||
Predictable,
|
||||
Static
|
||||
}
|
||||
}
|
||||
@@ -42,9 +42,12 @@ using System.ComponentModel.Design.Serialization;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Security.Permissions;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Util;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.UI.Adapters;
|
||||
using System.Web.UI.WebControls;
|
||||
using System.Web.Util;
|
||||
|
||||
#if NET_4_0
|
||||
using System.Web.Routing;
|
||||
@@ -86,6 +89,7 @@ namespace System.Web.UI
|
||||
static Dictionary <Type, bool> loadViewStateByIDCache;
|
||||
bool? loadViewStateByID;
|
||||
string uniqueID;
|
||||
string clientID;
|
||||
string _userId;
|
||||
ControlCollection _controls;
|
||||
Control _namingContainer;
|
||||
@@ -105,6 +109,10 @@ namespace System.Web.UI
|
||||
string _templateSourceDirectory;
|
||||
#if NET_4_0
|
||||
ViewStateMode viewStateMode;
|
||||
ClientIDMode? clientIDMode;
|
||||
ClientIDMode? effectiveClientIDMode;
|
||||
Version renderingCompatibility;
|
||||
bool? renderingCompatibilityOld;
|
||||
#endif
|
||||
/*************/
|
||||
int stateMask;
|
||||
@@ -190,6 +198,9 @@ namespace System.Web.UI
|
||||
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[EditorBrowsable (EditorBrowsableState.Never), Browsable (false)]
|
||||
#if NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
public Control BindingContainer {
|
||||
get {
|
||||
Control container = NamingContainer;
|
||||
@@ -205,18 +216,227 @@ namespace System.Web.UI
|
||||
[WebSysDescription ("An Identification of the control that is rendered.")]
|
||||
public virtual string ClientID {
|
||||
get {
|
||||
string client = UniqueID;
|
||||
if (clientID != null)
|
||||
return clientID;
|
||||
#if NET_4_0
|
||||
switch (EffectiveClientIDMode) {
|
||||
case ClientIDMode.AutoID:
|
||||
clientID = UniqueID2ClientID (UniqueID);
|
||||
break;
|
||||
|
||||
if (client != null)
|
||||
client = UniqueID2ClientID (client);
|
||||
case ClientIDMode.Predictable:
|
||||
EnsureID ();
|
||||
clientID = GeneratePredictableClientID ();
|
||||
break;
|
||||
|
||||
case ClientIDMode.Static:
|
||||
EnsureID ();
|
||||
clientID = ID;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
clientID = UniqueID2ClientID (UniqueID);
|
||||
#endif
|
||||
stateMask |= ID_SET;
|
||||
return client;
|
||||
return clientID;
|
||||
}
|
||||
}
|
||||
#if NET_4_0
|
||||
[Bindable (false)]
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
public virtual Version RenderingCompatibility {
|
||||
get {
|
||||
if (renderingCompatibility == null) {
|
||||
var ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
|
||||
renderingCompatibility = ps != null ? ps.ControlRenderingCompatibilityVersion : new Version (4, 0);
|
||||
}
|
||||
|
||||
return renderingCompatibility;
|
||||
}
|
||||
|
||||
set {
|
||||
renderingCompatibility = value;
|
||||
renderingCompatibilityOld = null;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool RenderingCompatibilityLessThan40 {
|
||||
get {
|
||||
if (!renderingCompatibilityOld.HasValue)
|
||||
renderingCompatibilityOld = RenderingCompatibility < new Version (4, 0);
|
||||
|
||||
return renderingCompatibilityOld.Value;
|
||||
}
|
||||
}
|
||||
|
||||
[Bindable (false)]
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[EditorBrowsableAttribute (EditorBrowsableState.Never)]
|
||||
public Control DataItemContainer {
|
||||
get {
|
||||
Control container = NamingContainer;
|
||||
if (container == null)
|
||||
return null;
|
||||
|
||||
if (container is IDataItemContainer)
|
||||
return container;
|
||||
|
||||
return container.DataItemContainer;
|
||||
}
|
||||
}
|
||||
|
||||
[Bindable (false)]
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[EditorBrowsableAttribute (EditorBrowsableState.Never)]
|
||||
public Control DataKeysContainer {
|
||||
get {
|
||||
Control container = NamingContainer;
|
||||
if (container == null)
|
||||
return null;
|
||||
|
||||
if (container is IDataKeysControl)
|
||||
return container;
|
||||
|
||||
return container.DataKeysContainer;
|
||||
}
|
||||
}
|
||||
|
||||
[Themeable (false)]
|
||||
[DefaultValue (ClientIDMode.Inherit)]
|
||||
public virtual ClientIDMode ClientIDMode {
|
||||
get {
|
||||
if (!clientIDMode.HasValue)
|
||||
return ClientIDMode.Inherit;
|
||||
|
||||
return clientIDMode.Value;
|
||||
}
|
||||
|
||||
set {
|
||||
if (clientIDMode.HasValue && clientIDMode.Value != value) {
|
||||
ClearCachedClientID ();
|
||||
ClearEffectiveClientIDMode ();
|
||||
clientIDMode = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal ClientIDMode EffectiveClientIDMode {
|
||||
get {
|
||||
if (effectiveClientIDMode.HasValue)
|
||||
return effectiveClientIDMode.Value;
|
||||
|
||||
ClientIDMode ret = ClientIDMode;
|
||||
if (ret != ClientIDMode.Inherit) {
|
||||
effectiveClientIDMode = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
// not sure about this, but it seems logical as INamingContainer is
|
||||
// the top of the hierarchy and it should "reset" the mode.
|
||||
Control container = NamingContainer;
|
||||
if (container != null) {
|
||||
effectiveClientIDMode = container.EffectiveClientIDMode;
|
||||
return effectiveClientIDMode.Value;
|
||||
}
|
||||
|
||||
var ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
|
||||
effectiveClientIDMode = ps.ClientIDMode;
|
||||
|
||||
return effectiveClientIDMode.Value;
|
||||
}
|
||||
}
|
||||
|
||||
protected void ClearCachedClientID ()
|
||||
{
|
||||
clientID = null;
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < _controls.Count; i++)
|
||||
_controls [i].ClearCachedClientID ();
|
||||
}
|
||||
|
||||
protected void ClearEffectiveClientIDMode ()
|
||||
{
|
||||
effectiveClientIDMode = null;
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < _controls.Count; i++)
|
||||
_controls [i].ClearEffectiveClientIDMode ();
|
||||
}
|
||||
|
||||
string GeneratePredictableClientID ()
|
||||
{
|
||||
string myID = ID;
|
||||
char separator = ClientIDSeparator;
|
||||
|
||||
var sb = new StringBuilder ();
|
||||
Control container = NamingContainer;
|
||||
if (container != null && container != Page) {
|
||||
string containerID = container.ID;
|
||||
if (!String.IsNullOrEmpty (containerID)) {
|
||||
sb.Append (container.ClientID);
|
||||
sb.Append (separator);
|
||||
} else
|
||||
sb.Append (container.GeneratePredictableClientID ());
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty (myID))
|
||||
return sb.ToString ();
|
||||
|
||||
sb.Append (myID);
|
||||
IDataItemContainer dataItemContainer = DataItemContainer as IDataItemContainer;
|
||||
if (dataItemContainer == null)
|
||||
return sb.ToString ();
|
||||
|
||||
IDataKeysControl dataKeysContainer = DataKeysContainer as IDataKeysControl;
|
||||
GetDataBoundControlFieldValue (sb, separator, dataItemContainer, dataKeysContainer);
|
||||
|
||||
return sb.ToString ();
|
||||
}
|
||||
|
||||
void GetDataBoundControlFieldValue (StringBuilder sb, char separator, IDataItemContainer dataItemContainer, IDataKeysControl dataKeysContainer)
|
||||
{
|
||||
if (dataItemContainer is IDataBoundItemControl)
|
||||
return;
|
||||
|
||||
int index = dataItemContainer.DisplayIndex;
|
||||
if (dataKeysContainer == null) {
|
||||
if (index >= 0) {
|
||||
sb.Append (separator);
|
||||
sb.Append (index);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
string[] suffixes = dataKeysContainer.ClientIDRowSuffix;
|
||||
DataKeyArray keys = dataKeysContainer.ClientIDRowSuffixDataKeys;
|
||||
if (keys == null || suffixes == null || suffixes.Length == 0) {
|
||||
sb.Append (separator);
|
||||
sb.Append (index);
|
||||
return;
|
||||
}
|
||||
|
||||
object value;
|
||||
DataKey key = keys [index];
|
||||
foreach (string suffix in suffixes) {
|
||||
sb.Append (separator);
|
||||
value = key != null ? key [suffix] : null;
|
||||
if (value == null)
|
||||
continue;
|
||||
sb.Append (value.ToString ());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
internal string UniqueID2ClientID (string uniqueId)
|
||||
{
|
||||
if (String.IsNullOrEmpty (uniqueId))
|
||||
return null;
|
||||
|
||||
return uniqueId.Replace (IdSeparator, ClientIDSeparator);
|
||||
}
|
||||
|
||||
@@ -301,6 +521,9 @@ namespace System.Web.UI
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("The container that this control is part of. The control's name has to be unique within the container.")]
|
||||
#if NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
public virtual Control NamingContainer {
|
||||
get {
|
||||
if (_namingContainer == null && _parent != null) {
|
||||
@@ -335,6 +558,9 @@ namespace System.Web.UI
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
[Browsable (false)]
|
||||
[WebSysDescription ("The parent control of this control.")]
|
||||
#if NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
public virtual Control Parent { //DIT
|
||||
get { return _parent; }
|
||||
}
|
||||
@@ -349,6 +575,9 @@ namespace System.Web.UI
|
||||
|
||||
[Browsable (false)]
|
||||
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
|
||||
#if NET_4_0
|
||||
[Bindable (true)]
|
||||
#endif
|
||||
public TemplateControl TemplateControl {
|
||||
get { return TemplateControlInternal; }
|
||||
|
||||
@@ -412,13 +641,13 @@ namespace System.Web.UI
|
||||
if (uniqueID != null)
|
||||
return uniqueID;
|
||||
|
||||
if (NamingContainer == null)
|
||||
Control container = NamingContainer;
|
||||
if (container == null)
|
||||
return _userId;
|
||||
|
||||
EnsureIDInternal ();
|
||||
|
||||
string prefix = NamingContainer.UniqueID;
|
||||
if (NamingContainer == Page || prefix == null) {
|
||||
string prefix = container.UniqueID;
|
||||
if (container == Page || prefix == null) {
|
||||
uniqueID = _userId;
|
||||
#if TARGET_J2EE
|
||||
if (getFacesContext () != null)
|
||||
@@ -566,6 +795,9 @@ namespace System.Web.UI
|
||||
void NullifyUniqueID ()
|
||||
{
|
||||
uniqueID = null;
|
||||
#if NET_4_0
|
||||
ClearCachedClientID ();
|
||||
#endif
|
||||
if (!HasControls ())
|
||||
return;
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack <[email protected]>
|
||||
//
|
||||
// (C) 2010 Novell, Inc. (http://novell.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace System.Web.UI
|
||||
{
|
||||
public interface IDataKeysControl
|
||||
{
|
||||
string[] ClientIDRowSuffix { get; }
|
||||
DataKeyArray ClientIDRowSuffixDataKeys { get; }
|
||||
}
|
||||
}
|
||||
@@ -459,8 +459,10 @@ namespace System.Web.UI
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
public static Type GetCompiledPageType (string virtualPath, string inputFile, HttpContext context)
|
||||
#if !NET_4_0
|
||||
public static
|
||||
#endif
|
||||
Type GetCompiledPageType (string virtualPath, string inputFile, HttpContext context)
|
||||
{
|
||||
return BuildManager.GetCompiledType (virtualPath);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ namespace System.Web.UI
|
||||
bool autoEventWireup = true;
|
||||
bool enableViewState = true;
|
||||
CompilationMode compilationMode = CompilationMode.Always;
|
||||
#if NET_4_0
|
||||
ClientIDMode? clientIDMode;
|
||||
#endif
|
||||
TextReader reader;
|
||||
|
||||
protected TemplateControlParser ()
|
||||
@@ -67,19 +70,26 @@ namespace System.Web.UI
|
||||
autoEventWireup = GetBool (atts, "AutoEventWireup", autoEventWireup);
|
||||
enableViewState = GetBool (atts, "EnableViewState", enableViewState);
|
||||
|
||||
string cmode = GetString (atts, "CompilationMode", compilationMode.ToString ());
|
||||
if (!String.IsNullOrEmpty (cmode)) {
|
||||
if (String.Compare (cmode, "always", StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
compilationMode = CompilationMode.Always;
|
||||
else if (String.Compare (cmode, "auto", StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
compilationMode = CompilationMode.Auto;
|
||||
else if (String.Compare (cmode, "never", StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
compilationMode = CompilationMode.Never;
|
||||
else
|
||||
ThrowParseException ("Invalid value of the CompilationMode attribute");
|
||||
string value = GetString (atts, "CompilationMode", compilationMode.ToString ());
|
||||
if (!String.IsNullOrEmpty (value)) {
|
||||
try {
|
||||
compilationMode = (CompilationMode) Enum.Parse (typeof (CompilationMode), value, true);
|
||||
} catch (Exception ex) {
|
||||
ThrowParseException ("Invalid value of the CompilationMode attribute.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
atts.Remove ("TargetSchema"); // Ignored
|
||||
|
||||
#if NET_4_0
|
||||
value = GetString (atts, "ClientIDMode", null);
|
||||
if (!String.IsNullOrEmpty (value)) {
|
||||
try {
|
||||
clientIDMode = (ClientIDMode) Enum.Parse (typeof (ClientIDMode), value, true);
|
||||
} catch (Exception ex) {
|
||||
ThrowParseException ("Invalid value of the ClientIDMode attribute.", ex);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
base.ProcessMainAttributes (atts);
|
||||
}
|
||||
|
||||
@@ -196,8 +206,12 @@ namespace System.Web.UI
|
||||
|
||||
internal CompilationMode CompilationMode {
|
||||
get { return compilationMode; }
|
||||
}
|
||||
#if NET_4_0
|
||||
internal ClientIDMode? ClientIDMode {
|
||||
get { return clientIDMode; }
|
||||
}
|
||||
|
||||
#endif
|
||||
internal override TextReader Reader {
|
||||
get { return reader; }
|
||||
set { reader = value; }
|
||||
|
||||
@@ -14,3 +14,8 @@ Test/standalone-tests/FormViewUpdateParameters_Bug607722.cs
|
||||
Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs
|
||||
Test/standalone-tests/MD5PasswordAuth_Bug601727.cs
|
||||
Test/standalone-tests/WebControlsMustUseIsEnabled_Bug571715.cs
|
||||
Test/standalone-tests/ControlRenderingCompatibilityVersion.cs
|
||||
Test/standalone-tests/DisabledAttributeRendering.cs
|
||||
Test/standalone-tests/GridViewShowHeaderWhenEmpty.cs
|
||||
Test/standalone-tests/GridViewSortingStyles.cs
|
||||
Test/standalone-tests/SiteMapPathRendering.cs
|
||||
@@ -264,6 +264,7 @@ System.Web.UI.WebControls/RectangleHotSpotTest.cs
|
||||
System.Web.UI.WebControls/RegularExpressionValidatorTest.cs
|
||||
System.Web.UI.WebControls/RepeatInfoTest.auto.cs
|
||||
System.Web.UI.WebControls/RepeatInfoTest.auto.2.0.cs
|
||||
System.Web.UI.WebControls/RepeatInfoTest.auto.4.0.cs
|
||||
System.Web.UI.WebControls/RepeatInfoTest.cs
|
||||
System.Web.UI.WebControls/RepeaterItemCollectionTest.cs
|
||||
System.Web.UI.WebControls/RepeaterTest.cs
|
||||
|
||||
@@ -165,8 +165,13 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
{
|
||||
WebTest t = new WebTest ("CheckBoxList_Bug377703_1.aspx");
|
||||
t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug377703_1_OnInit);
|
||||
#if NET_4_0
|
||||
string origHtmlFirst = "<table id=\"cbxl1\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" value=\"x\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" value=\"y\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" value=\"z\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"cbxl1\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" checked=\"checked\" value=\"x\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" value=\"y\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" value=\"z\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlFirst = "<table id=\"cbxl1\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"cbxl1\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl1_0\" type=\"checkbox\" name=\"cbxl1$0\" checked=\"checked\" /><label for=\"cbxl1_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_1\" type=\"checkbox\" name=\"cbxl1$1\" /><label for=\"cbxl1_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl1_2\" type=\"checkbox\" name=\"cbxl1$2\" /><label for=\"cbxl1_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
string html = t.Run ();
|
||||
string listHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
|
||||
@@ -215,9 +220,15 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
{
|
||||
WebTest t = new WebTest ("CheckBoxList_Bug377703_2.aspx");
|
||||
t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug377703_2_OnInit);
|
||||
#if NET_4_0
|
||||
string origHtmlFirst = "<table id=\"cbxl2\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" value=\"x\" /><label for=\"cbxl2_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" value=\"y\" /><label for=\"cbxl2_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" value=\"z\" /><label for=\"cbxl2_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"cbxl2\" class=\"aspNetDisabled\">\r\n\t<tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" checked=\"checked\" disabled=\"disabled\" value=\"x\" /><label for=\"cbxl2_0\">x</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" disabled=\"disabled\" value=\"y\" /><label for=\"cbxl2_1\">y</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" checked=\"checked\" disabled=\"disabled\" value=\"z\" /><label for=\"cbxl2_2\">z</label></span></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlThird = "<table id=\"cbxl2\" class=\"aspNetDisabled\">\r\n\t<tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" checked=\"checked\" disabled=\"disabled\" value=\"x\" /><label for=\"cbxl2_0\">x</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" disabled=\"disabled\" value=\"y\" /><label for=\"cbxl2_1\">y</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" checked=\"checked\" disabled=\"disabled\" value=\"z\" /><label for=\"cbxl2_2\">z</label></span></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlFirst = "<table id=\"cbxl2\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" /><label for=\"cbxl2_0\">x</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" /><label for=\"cbxl2_1\">y</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" /><label for=\"cbxl2_2\">z</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"cbxl2\" disabled=\"disabled\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" checked=\"checked\" disabled=\"disabled\" /><label for=\"cbxl2_0\">x</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" disabled=\"disabled\" /><label for=\"cbxl2_1\">y</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" checked=\"checked\" disabled=\"disabled\" /><label for=\"cbxl2_2\">z</label></span></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlThird = "<table id=\"cbxl2\" disabled=\"disabled\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_0\" type=\"checkbox\" name=\"cbxl2$0\" checked=\"checked\" disabled=\"disabled\" /><label for=\"cbxl2_0\">x</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_1\" type=\"checkbox\" name=\"cbxl2$1\" disabled=\"disabled\" /><label for=\"cbxl2_1\">y</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"cbxl2_2\" type=\"checkbox\" name=\"cbxl2$2\" checked=\"checked\" disabled=\"disabled\" /><label for=\"cbxl2_2\">z</label></span></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
string html = t.Run ();
|
||||
string listHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
|
||||
@@ -270,7 +281,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
{
|
||||
WebTest t = new WebTest ("CheckBoxList_Bug578770.aspx");
|
||||
t.Invoker = PageInvoker.CreateOnInit (CheckBoxList_Bug578770_OnInit);
|
||||
#if NET_4_0
|
||||
string origHtml = "<table id=\"test\">\r\n\t<tr>\r\n\t\t<td><span class=\"aspNetDisabled\"><input id=\"test_0\" type=\"checkbox\" name=\"test$0\" disabled=\"disabled\" value=\"Sun\" /><label for=\"test_0\">Sun</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_1\" type=\"checkbox\" name=\"test$1\" value=\"Mon\" /><label for=\"test_1\">Mon</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_2\" type=\"checkbox\" name=\"test$2\" value=\"Tue\" /><label for=\"test_2\">Tue</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_3\" type=\"checkbox\" name=\"test$3\" value=\"Wed\" /><label for=\"test_3\">Wed</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_4\" type=\"checkbox\" name=\"test$4\" value=\"Thu\" /><label for=\"test_4\">Thu</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_5\" type=\"checkbox\" name=\"test$5\" value=\"Fri\" /><label for=\"test_5\">Fri</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><span><input id=\"test_6\" type=\"checkbox\" name=\"test$6\" value=\"Sat\" /><label for=\"test_6\">Sat</label></span></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtml = "<table id=\"test\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><span disabled=\"disabled\"><input id=\"test_0\" type=\"checkbox\" name=\"test$0\" disabled=\"disabled\" /><label for=\"test_0\">Sun</label></span></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_1\" type=\"checkbox\" name=\"test$1\" /><label for=\"test_1\">Mon</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_2\" type=\"checkbox\" name=\"test$2\" /><label for=\"test_2\">Tue</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_3\" type=\"checkbox\" name=\"test$3\" /><label for=\"test_3\">Wed</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_4\" type=\"checkbox\" name=\"test$4\" /><label for=\"test_4\">Thu</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_5\" type=\"checkbox\" name=\"test$5\" /><label for=\"test_5\">Fri</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"test_6\" type=\"checkbox\" name=\"test$6\" /><label for=\"test_6\">Sat</label></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
string html = t.Run ();
|
||||
string listHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
|
||||
@@ -290,9 +305,15 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
public void CheckBoxList_Bug600415 ()
|
||||
{
|
||||
WebTest t = new WebTest ("CheckBoxList_Bug600415.aspx");
|
||||
#if NET_4_0
|
||||
string origHtmlFirst = "<table id=\"checkBoxList\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" checked=\"checked\" value=\"Item 1\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" value=\"Item 2\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" checked=\"checked\" value=\"Item 3\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" value=\"Item 4\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"checkBoxList\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" value=\"Item 1\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" value=\"Item 2\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" value=\"Item 3\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" value=\"Item 4\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlThird = "<table id=\"checkBoxList\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" checked=\"checked\" value=\"Item 1\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" checked=\"checked\" value=\"Item 2\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" checked=\"checked\" value=\"Item 3\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" checked=\"checked\" value=\"Item 4\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlFirst = "<table id=\"checkBoxList\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" checked=\"checked\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" checked=\"checked\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlSecond = "<table id=\"checkBoxList\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
string origHtmlThird = "<table id=\"checkBoxList\" border=\"0\">\r\n\t<tr>\r\n\t\t<td><input id=\"checkBoxList_0\" type=\"checkbox\" name=\"checkBoxList$0\" checked=\"checked\" /><label for=\"checkBoxList_0\">Item 1</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_1\" type=\"checkbox\" name=\"checkBoxList$1\" checked=\"checked\" /><label for=\"checkBoxList_1\">Item 2</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_2\" type=\"checkbox\" name=\"checkBoxList$2\" checked=\"checked\" /><label for=\"checkBoxList_2\">Item 3</label></td>\r\n\t</tr><tr>\r\n\t\t<td><input id=\"checkBoxList_3\" type=\"checkbox\" name=\"checkBoxList$3\" checked=\"checked\" /><label for=\"checkBoxList_3\">Item 4</label></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
string html = t.Run ();
|
||||
string listHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
|
||||
@@ -370,6 +391,13 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
[Test]
|
||||
public void RenderItem ()
|
||||
{
|
||||
#if NET_4_0
|
||||
string origHtml1 = "<input id=\"0\" type=\"checkbox\" name=\"0\" value=\"value1\" /><label for=\"0\">item1</label>";
|
||||
string origHtml2 = "<input id=\"1\" type=\"checkbox\" name=\"1\" value=\"value2\" /><label for=\"1\">item2</label>";
|
||||
#else
|
||||
string origHtml1 = "<input id=\"0\" type=\"checkbox\" name=\"0\" /><label for=\"0\">item1</label>";
|
||||
string origHtml2 = "<input id=\"1\" type=\"checkbox\" name=\"1\" /><label for=\"1\">item2</label>";
|
||||
#endif
|
||||
CheckBoxListPoker c = new CheckBoxListPoker ();
|
||||
ListItem l1 = new ListItem ("item1", "value1");
|
||||
ListItem l2 = new ListItem ("item2", "value2");
|
||||
@@ -377,9 +405,9 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
c.Items.Add (l1);
|
||||
c.Items.Add (l2);
|
||||
string html = c.RenderItem (ListItemType.Item, 0, null);
|
||||
HtmlDiff.AssertAreEqual ("<input id=\"0\" type=\"checkbox\" name=\"0\" /><label for=\"0\">item1</label>", html, "RenderItem#1");
|
||||
HtmlDiff.AssertAreEqual (origHtml1, html, "RenderItem#1");
|
||||
html = c.RenderItem (ListItemType.Item, 1, null);
|
||||
HtmlDiff.AssertAreEqual ("<input id=\"1\" type=\"checkbox\" name=\"1\" /><label for=\"1\">item2</label>", html, "RenderItem#2");
|
||||
HtmlDiff.AssertAreEqual (origHtml2, html, "RenderItem#2");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -539,6 +567,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
[Test]
|
||||
public void RepeatInfoRenderItem ()
|
||||
{
|
||||
#if NET_4_0
|
||||
string origHtml = "<input id=\"0\" type=\"checkbox\" name=\"0\" value=\"one\" /><label for=\"0\">one</label>";
|
||||
#else
|
||||
string origHtml = "<input id=\"0\" type=\"checkbox\" name=\"0\" /><label for=\"0\">one</label>";
|
||||
#endif
|
||||
StringWriter sw = new StringWriter ();
|
||||
HtmlTextWriter tw = new HtmlTextWriter (sw);
|
||||
CheckBoxList c = new CheckBoxList ();
|
||||
@@ -548,9 +581,9 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
c.Items.Add ("one");
|
||||
c.Items.Add ("two");
|
||||
|
||||
ri.RenderItem (ListItemType.Item, 0, r, tw);
|
||||
Assert.AreEqual ("<input id=\"0\" type=\"checkbox\" name=\"0\" />" +
|
||||
"<label for=\"0\">one</label>", sw.ToString (), "A1");
|
||||
ri.RenderItem (ListItemType.Item, 0, r, tw);
|
||||
string html = sw.ToString ();
|
||||
Assert.AreEqual (origHtml, html, "A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -631,20 +664,22 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
#endif
|
||||
public void Render ()
|
||||
{
|
||||
#if NET_4_0
|
||||
string origHtml1 = "<table>\n\t<tr>\n\t\t<td><input id=\"0\" name=\"0\" type=\"checkbox\" value=\"foo\"/><label for=\"0\">foo</label></td>\n\t</tr>\n</table>";
|
||||
string origHtml2 = "<table>\n\t<tr>\n\t\t<td><input id=\"0\" name=\"0\" type=\"checkbox\" value=\"foo\"/><label for=\"0\">foo</label></td>\n\t</tr>\n</table>";
|
||||
#else
|
||||
string origHtml1 = "<table border=\"0\">\n\t<tr>\n\t\t<td><input id=\"0\" name=\"0\" type=\"checkbox\" /><label for=\"0\">foo</label></td>\n\t</tr>\n</table>";
|
||||
string origHtml2 = "<table border=\"0\">\n\t<tr>\n\t\t<td><input id=\"0\" name=\"0\" type=\"checkbox\" /><label for=\"0\">foo</label></td>\n\t</tr>\n</table>";
|
||||
#endif
|
||||
CheckBoxList c;
|
||||
c = new CheckBoxList ();
|
||||
c.Items.Add ("foo");
|
||||
Render (c, "<table border=\"0\">\n\t<tr>\n\t\t<td><input id=\"0\" " +
|
||||
"name=\"0\" type=\"checkbox\" />" +
|
||||
"<label for=\"0\">foo</label>" +
|
||||
"</td>\n\t</tr>\n</table>", "A5");
|
||||
|
||||
Render (c, origHtml1, "A5");
|
||||
|
||||
c = new CheckBoxList ();
|
||||
c.Items.Add ("foo");
|
||||
Render (c, "<table border=\"0\">\n\t<tr>\n\t\t<td><input id=\"0\" " +
|
||||
"name=\"0\" type=\"checkbox\" />" +
|
||||
"<label for=\"0\">foo</label>" +
|
||||
"</td>\n\t</tr>\n</table>", "A6");
|
||||
Render (c, origHtml2, "A6");
|
||||
}
|
||||
|
||||
// bug 51648
|
||||
@@ -657,11 +692,19 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
CheckBoxList c = new CheckBoxList ();
|
||||
c.TabIndex = 5;
|
||||
c.Items.Add ("Item1");
|
||||
#if NET_4_0
|
||||
string exp = @"<table>
|
||||
<tr>
|
||||
<td><input id=""0"" name=""0"" tabindex=""5"" type=""checkbox"" value=""Item1""/><label for=""0"">Item1</label></td>
|
||||
</tr>
|
||||
</table>";
|
||||
#else
|
||||
string exp = @"<table border=""0"">
|
||||
<tr>
|
||||
<td><input id=""0"" name=""0"" tabindex=""5"" type=""checkbox"" /><label for=""0"">Item1</label></td>
|
||||
</tr>
|
||||
</table>";
|
||||
#endif
|
||||
Render (c, exp, "B1");
|
||||
}
|
||||
|
||||
@@ -675,11 +718,19 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
CheckBoxList c = new CheckBoxList ();
|
||||
c.Enabled = false;
|
||||
c.Items.Add ("Item1");
|
||||
#if NET_4_0
|
||||
string exp = @"<table class=""aspNetDisabled"">
|
||||
<tr>
|
||||
<td><span class=""aspNetDisabled""><input disabled=""disabled"" id=""0"" name=""0"" type=""checkbox"" value=""Item1""/><label for=""0"">Item1</label></span></td>
|
||||
</tr>
|
||||
</table>";
|
||||
#else
|
||||
string exp = @"<table border=""0"" disabled=""disabled"">
|
||||
<tr>
|
||||
<td><span disabled=""disabled""><input disabled=""disabled"" id=""0"" name=""0"" type=""checkbox"" /><label for=""0"">Item1</label></span></td>
|
||||
</tr>
|
||||
</table>";
|
||||
#endif
|
||||
Render (c, exp, "C1");
|
||||
}
|
||||
#if NET_2_0
|
||||
|
||||
@@ -184,6 +184,21 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
HtmlDiff.AssertAreEqual ("<input type=\"checkbox\" Atribute=\"Test\" />", html, "Input Attribute fail");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void InputAttributesTest2 ()
|
||||
{
|
||||
TestCheckBox c = new TestCheckBox ();
|
||||
c.InputAttributes.Add ("value", "value1");
|
||||
c.Text = "Title";
|
||||
c.Checked = true;
|
||||
#if NET_4_0
|
||||
string origHtml = "<input id=\"\" type=\"checkbox\" checked=\"checked\" value=\"value1\" /><label for=\"\">Title</label>";
|
||||
#else
|
||||
string origHtml = "<input type=\"checkbox\" checked=\"checked\" value=\"value1\" /><label for>Title</label>";
|
||||
#endif
|
||||
string html = c.Render ();
|
||||
HtmlDiff.AssertAreEqual (origHtml, html, "#A1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void LabelAttributesTest_1 ()
|
||||
|
||||
@@ -1605,7 +1605,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit);
|
||||
string html = t.Run ();
|
||||
string gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render");
|
||||
|
||||
@@ -1622,7 +1626,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>6</td><td>heh6</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>6</td><td>heh6</td><td>Comment 6</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>7</td><td>heh7</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>7</td><td>heh7</td><td>Comment 7</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>8</td><td>heh8</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>8</td><td>heh8</td><td>Comment 8</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>9</td><td>heh9</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>9</td><td>heh9</td><td>Comment 9</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>10</td><td>heh10</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>10</td><td>heh10</td><td>Comment 10</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl00','')\" style=\"color:#333333;\">Previous</a> <span>Next</span></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>6</td><td>heh6</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>6</td><td>heh6</td><td>Comment 6</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>7</td><td>heh7</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>7</td><td>heh7</td><td>Comment 7</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>8</td><td>heh8</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>8</td><td>heh8</td><td>Comment 8</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>9</td><td>heh9</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>9</td><td>heh9</td><td>Comment 9</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>10</td><td>heh10</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>10</td><td>heh10</td><td>Comment 10</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl00','')\" style=\"color:#333333;\">Previous</a> <span>Next</span></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Paging Next");
|
||||
|
||||
fr = new FormRequest (t.Response, "form1");
|
||||
@@ -1650,7 +1658,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit);
|
||||
string html = t.Run ();
|
||||
string gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render");
|
||||
|
||||
@@ -1667,7 +1679,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:Green;font-weight:normal;font-style:normal;text-decoration:none;\">\r\n\t\t<td>1</td><td><input name=\"DataGrid1$ctl03$ctl00\" type=\"text\" value=\"heh1\" /></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Update</a> <a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl02','')\" style=\"color:#333333;\">Cancel</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl03','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td><input name=\"DataGrid1$ctl03$ctl04\" type=\"text\" value=\"heh1\" /></td><td><input name=\"DataGrid1$ctl03$ctl05\" type=\"text\" value=\"Comment 1\" /></td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:Green;font-weight:normal;font-style:normal;text-decoration:none;\">\r\n\t\t<td>1</td><td><input name=\"DataGrid1$ctl03$ctl00\" type=\"text\" value=\"heh1\" /></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Update</a> <a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl02','')\" style=\"color:#333333;\">Cancel</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl03','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td><input name=\"DataGrid1$ctl03$ctl04\" type=\"text\" value=\"heh1\" /></td><td><input name=\"DataGrid1$ctl03$ctl05\" type=\"text\" value=\"Comment 1\" /></td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Edit");
|
||||
|
||||
fr = new FormRequest (t.Response, "form1");
|
||||
@@ -1690,7 +1706,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedThirdPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>New Value</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>New Value</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedThirdPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>New Value</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>New Value</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedThirdPage, gridHtml, "DataGrid Update");
|
||||
|
||||
@@ -1707,7 +1727,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedFourthPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>New Value</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>New Value</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>6</td><td>heh6</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>6</td><td>heh6</td><td>Comment 6</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedFourthPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>New Value</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>New Value</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>6</td><td>heh6</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>6</td><td>heh6</td><td>Comment 6</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedFourthPage, gridHtml, "DataGrid Delete");
|
||||
}
|
||||
@@ -1720,7 +1744,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Invoker = PageInvoker.CreateOnInit (DataGrid_OnInit);
|
||||
string html = t.Run ();
|
||||
string gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedFirstPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedFirstPage, gridHtml, "DataGrid initial Render");
|
||||
|
||||
@@ -1733,7 +1761,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:Navy;background-color:#FFCC66;font-weight:bold;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:Navy;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:Navy;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedSecondPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:Navy;background-color:#FFCC66;font-weight:bold;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:Navy;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:Navy;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (expectedSecondPage, gridHtml, "DataGrid Selected 1");
|
||||
|
||||
fr = new FormRequest (t.Response, "form1");
|
||||
@@ -1745,7 +1777,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
html = t.Run ();
|
||||
gridHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string expectedThirdPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:Navy;background-color:#FFCC66;font-weight:bold;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:Navy;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:Navy;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string expectedThirdPage = "\n <table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"DataGrid1\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td>ID</td><td>Name</td><td> </td><td> </td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl00','')\" style=\"color:White;\">ID</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl01','')\" style=\"color:White;\">Name</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl02$ctl02','')\" style=\"color:White;\">Comment</a></td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>1</td><td>heh1</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl03$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>1</td><td>heh1</td><td>Comment 1</td>\r\n\t</tr><tr style=\"color:Navy;background-color:#FFCC66;font-weight:bold;\">\r\n\t\t<td>2</td><td>heh2</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl00','')\" style=\"color:Navy;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl04$ctl01','')\" style=\"color:Navy;\">Delete</a></td><td>2</td><td>heh2</td><td>Comment 2</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>3</td><td>heh3</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl05$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>3</td><td>heh3</td><td>Comment 3</td>\r\n\t</tr><tr style=\"color:#333333;background-color:White;\">\r\n\t\t<td>4</td><td>heh4</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl06$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>4</td><td>heh4</td><td>Comment 4</td>\r\n\t</tr><tr style=\"color:#333333;background-color:#FFFBD6;\">\r\n\t\t<td>5</td><td>heh5</td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl00','')\" style=\"color:#333333;\">Edit</a></td><td><a href=\"javascript:__doPostBack('DataGrid1$ctl07$ctl01','')\" style=\"color:#333333;\">Delete</a></td><td>5</td><td>heh5</td><td>Comment 5</td>\r\n\t</tr><tr style=\"color:White;background-color:#990000;font-weight:bold;\">\r\n\t\t<td> </td><td> </td><td> </td><td> </td><td> </td><td> </td><td> </td>\r\n\t</tr><tr align=\"center\" style=\"color:#333333;background-color:#FFCC66;\">\r\n\t\t<td colspan=\"4\"><span>Previous</span> <a href=\"javascript:__doPostBack('DataGrid1$ctl09$ctl01','')\" style=\"color:#333333;\">Next</a></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (expectedThirdPage, gridHtml, "DataGrid Selected 2");
|
||||
}
|
||||
|
||||
@@ -634,8 +634,12 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
fr.Controls["__EVENTARGUMENT"].Value = "";
|
||||
t.Request = fr;
|
||||
result = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (result);
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (result);
|
||||
#if NET_4_0
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#else
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual(origHtml, newHtml, "EmptyContentTest");
|
||||
}
|
||||
|
||||
@@ -678,7 +682,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Request = fr;
|
||||
result = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (result);
|
||||
#if NET_4_0
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#else
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual(origHtml, newHtml, "EmptyFooterTextTest");
|
||||
}
|
||||
|
||||
@@ -720,7 +728,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Request = fr;
|
||||
result = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (result);
|
||||
#if NET_4_0
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#else
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual(origHtml, newHtml, "EmptyHeaderTextTest");
|
||||
}
|
||||
|
||||
@@ -759,7 +771,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
//t.Invoker = PageInvoker.CreateOnLoad (pd);
|
||||
result = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (result);
|
||||
#if NET_4_0
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>Empty Data</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#else
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>Empty Data</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div><a id=\"LinkButton1\" href=\"javascript:__doPostBack('LinkButton1','')\">Test</a>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual(origHtml, newHtml, "EmptyDataTextTest");
|
||||
}
|
||||
|
||||
@@ -864,7 +880,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
string html = new WebTest (PageInvoker.CreateOnLoad (
|
||||
new PageDelegate (DetailsView_DeleteItem))).Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (html);
|
||||
#if NET_4_0
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "DeleteItemMethod");
|
||||
}
|
||||
|
||||
@@ -1183,9 +1203,13 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
PokerDetailsView dv = new PokerDetailsView ();
|
||||
Table tb = dv.DoCreateTable();
|
||||
Assert.AreEqual (null, tb.Parent, "CreateTable1");
|
||||
Assert.AreEqual ("", tb.BackImageUrl, "CreateTable2");
|
||||
Assert.AreEqual (String.Empty, tb.BackImageUrl, "CreateTable2");
|
||||
Assert.AreEqual (0, tb.Rows.Count, "CreateTable3");
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (String.Empty, tb.ClientID, "CreateTable3");
|
||||
#else
|
||||
Assert.AreEqual (null, tb.ClientID , "CreateTable3");
|
||||
#endif
|
||||
dv.ID = "testId"; //private filed _parentID should be set to "testId"
|
||||
tb = dv.DoCreateTable ();
|
||||
Assert.AreEqual (-1, tb.CellSpacing, "CreateTable4");
|
||||
@@ -1418,7 +1442,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
//Footer Template property is checked.
|
||||
string renderedPageHtml = new WebTest ("FooterTemplateTest.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\">\n Footer Template Test<a id=\"DetailsView1_HyperLink1\">Footer</a>\n </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\">\n Footer Template Test<a id=\"DetailsView1_HyperLink1\">Footer</a>\n </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderFooterTemplate");
|
||||
}
|
||||
@@ -1430,8 +1458,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
//Header Template property is checked
|
||||
string renderedPageHtml = new WebTest ("DetailsViewTemplates.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\">\n Header Template<input type=\"submit\" name=\"DetailsView1$Button1\" value=\"Header button\" id=\"DetailsView1_Button1\" />\n </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td colspan=\"2\">\n Header Template<input type=\"submit\" name=\"DetailsView1$Button1\" value=\"Header button\" id=\"DetailsView1_Button1\" />\n </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderHeaderTemplate");
|
||||
}
|
||||
|
||||
@@ -1453,7 +1484,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string renderedPageHtml = new WebTest ("DetailsViewTemplates_3.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView3\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView3','$0')\">TestButtonField</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td><a></a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Image field</td><td></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Template Field</td><td style=\"background-color:#FFE0C0;\"> </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView3','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView3','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView3\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView3','$0')\">TestButtonField</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td><a></a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Image field</td><td></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Template Field</td><td style=\"background-color:#FFE0C0;\"> </td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView3','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView3','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderDataFields");
|
||||
}
|
||||
@@ -1466,7 +1501,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Invoker = PageInvoker.CreateOnLoad (PagingPostback_Load);
|
||||
string pageHTML = t.Run ();
|
||||
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$0')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Mahesh</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Chand</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$0')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, renderedHtml, "BeforePagingDataPostback");
|
||||
FormRequest fr = new FormRequest (t.Response, "form1");
|
||||
fr.Controls.Add ("__EVENTTARGET");
|
||||
@@ -1476,7 +1515,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$1')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$1')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><a href=\"javascript:__doPostBack('DetailsView1','Page$1')\">1</a></td><td><span>2</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$1')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$1')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><a href=\"javascript:__doPostBack('DetailsView1','Page$1')\">1</a></td><td><span>2</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, renderedHtml, "AfterPagingDataPostback");
|
||||
|
||||
// Checking for change index event fired.
|
||||
@@ -1547,7 +1590,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td><input name=\"DetailsView1$ctl01\" type=\"text\" value=\"Mahesh\" title=\"FName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td><input name=\"DetailsView1$ctl02\" type=\"text\" value=\"Chand\" title=\"LName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1$ctl03','')\">Update</a> <a href=\"javascript:__doPostBack('DetailsView1','Cancel$0')\">Cancel</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1001</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td><input name=\"DetailsView1$ctl01\" type=\"text\" value=\"Mahesh\" title=\"FName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td><input name=\"DetailsView1$ctl02\" type=\"text\" value=\"Chand\" title=\"LName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1$ctl03','')\">Update</a> <a href=\"javascript:__doPostBack('DetailsView1','Cancel$0')\">Cancel</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$3')\">3</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, renderedHtml, "AfterEditPostback");
|
||||
// Checking for change mode event fired.
|
||||
ArrayList eventlist = t.UserData as ArrayList;
|
||||
@@ -1618,7 +1665,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
pageHTML = t.Run ();
|
||||
//Console.WriteLine ("XXXXFAIL {0}", pageHTML);
|
||||
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$0')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td>1002</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td>Melanie</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td>Talmadge</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('DetailsView1','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('DetailsView1','New$0')\">New</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('DetailsView1','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, renderedHtml, "DeleteDataPostback");
|
||||
Assert.AreEqual (false, renderedHtml.Contains ("1001"), "AfterDeletePostback");
|
||||
@@ -1690,7 +1741,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td><input name=\"DetailsView1$ctl01\" type=\"text\" title=\"ID\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td><input name=\"DetailsView1$ctl02\" type=\"text\" title=\"FName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td><input name=\"DetailsView1$ctl03\" type=\"text\" title=\"LName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1$ctl04','')\">Insert</a> <a href=\"javascript:__doPostBack('DetailsView1','Cancel$-1')\">Cancel</a></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string origHtmlValue = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"DetailsView1\" style=\"height:50px;width:125px;border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<td>ID</td><td><input name=\"DetailsView1$ctl01\" type=\"text\" title=\"ID\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FName</td><td><input name=\"DetailsView1$ctl02\" type=\"text\" title=\"FName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>LName</td><td><input name=\"DetailsView1$ctl03\" type=\"text\" title=\"LName\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td colspan=\"2\"><a href=\"javascript:__doPostBack('DetailsView1$ctl04','')\">Insert</a> <a href=\"javascript:__doPostBack('DetailsView1','Cancel$-1')\">Cancel</a></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, renderedHtml, "InsertDataPostback");
|
||||
|
||||
|
||||
@@ -1568,7 +1568,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
{
|
||||
string renderedPageHtml = new WebTest ("FormViewTest1.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_Label1\">1</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:#8C4510;\">\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\" style=\"color:#8C4510;\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\" style=\"color:#8C4510;\">3</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$4')\" style=\"color:#8C4510;\">4</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$5')\" style=\"color:#8C4510;\">5</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$6')\" style=\"color:#8C4510;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlValue = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" border=\"1\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_Label1\">1</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:#8C4510;\">\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\" style=\"color:#8C4510;\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\" style=\"color:#8C4510;\">3</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$4')\" style=\"color:#8C4510;\">4</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$5')\" style=\"color:#8C4510;\">5</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$6')\" style=\"color:#8C4510;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderSimpleTemplate");
|
||||
}
|
||||
@@ -1582,7 +1586,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
{
|
||||
string renderedPageHtml = new WebTest ("FormViewTest1_2.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"4\" id=\"FormView2\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:#333333;background-color:#F7F6F3;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView2_Label2\">1</span>\n </td>\r\n\t</tr><tr style=\"color:White;background-color:#5D7B9D;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView2_Label3\">Footer Template Test</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:White;background-color:#284775;\">\r\n\t\t<td colspan=\"2\">\n <input type=\"submit\" name=\"FormView2$ctl01$Button1\" value=\"Prev Item\" id=\"FormView2_ctl01_Button1\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button2\" value=\"Next Item\" id=\"FormView2_ctl01_Button2\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button3\" value=\"First Item\" id=\"FormView2_ctl01_Button3\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button4\" value=\"Last Item\" id=\"FormView2_ctl01_Button4\" />\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"4\" border=\"0\" id=\"FormView2\" style=\"color:#333333;border-collapse:collapse;\">\r\n\t<tr style=\"color:#333333;background-color:#F7F6F3;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView2_Label2\">1</span>\n </td>\r\n\t</tr><tr style=\"color:White;background-color:#5D7B9D;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView2_Label3\">Footer Template Test</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:White;background-color:#284775;\">\r\n\t\t<td colspan=\"2\">\n <input type=\"submit\" name=\"FormView2$ctl01$Button1\" value=\"Prev Item\" id=\"FormView2_ctl01_Button1\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button2\" value=\"Next Item\" id=\"FormView2_ctl01_Button2\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button3\" value=\"First Item\" id=\"FormView2_ctl01_Button3\" />\n <input type=\"submit\" name=\"FormView2$ctl01$Button4\" value=\"Last Item\" id=\"FormView2_ctl01_Button4\" />\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "FormView_RenderFooterAndPager");
|
||||
}
|
||||
|
||||
@@ -1595,7 +1603,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
{
|
||||
string renderedPageHtml = new WebTest ("FormViewTest1_4.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (renderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<table cellspacing=\"10\" cellpadding=\"3\" align=\"Right\" rules=\"all\" id=\"FormView4\" style=\"background-color:White;border-color:#CCCCCC;border-width:1px;border-style:None;\">\r\n\t<tr align=\"left\" style=\"color:White;background-color:#006699;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">Using Header Text property</td>\r\n\t</tr><tr align=\"center\" style=\"color:#000066;background-color:Maroon;\">\r\n\t\t<td colspan=\"2\">Using Footer Text property</td>\r\n\t</tr><tr align=\"left\" style=\"color:#000066;background-color:LightGrey;\">\r\n\t\t<td colspan=\"2\">\n <a id=\"FormView4_ctl01_LinkButton1\" href=\"javascript:__doPostBack('FormView4$ctl01$LinkButton1','')\">Next</a>\n <a id=\"FormView4_ctl01_LinkButton2\" href=\"javascript:__doPostBack('FormView4$ctl01$LinkButton2','')\">Prev</a>\n <span id=\"FormView4_ctl01_Label7\">Page Index: 0</span>\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlValue = "<table cellspacing=\"10\" cellpadding=\"3\" align=\"Right\" rules=\"all\" border=\"1\" id=\"FormView4\" style=\"background-color:White;border-color:#CCCCCC;border-width:1px;border-style:None;\">\r\n\t<tr align=\"left\" style=\"color:White;background-color:#006699;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">Using Header Text property</td>\r\n\t</tr><tr align=\"center\" style=\"color:#000066;background-color:Maroon;\">\r\n\t\t<td colspan=\"2\">Using Footer Text property</td>\r\n\t</tr><tr align=\"left\" style=\"color:#000066;background-color:LightGrey;\">\r\n\t\t<td colspan=\"2\">\n <a id=\"FormView4_ctl01_LinkButton1\" href=\"javascript:__doPostBack('FormView4$ctl01$LinkButton1','')\">Next</a>\n <a id=\"FormView4_ctl01_LinkButton2\" href=\"javascript:__doPostBack('FormView4$ctl01$LinkButton2','')\">Prev</a>\n <span id=\"FormView4_ctl01_Label7\">Page Index: 0</span>\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging");
|
||||
}
|
||||
|
||||
@@ -1609,7 +1621,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
{
|
||||
string RenderedPageHtml = new WebTest ("FormViewTest1_3.aspx").Run ();
|
||||
string newHtmlValue = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"2\" id=\"FormView3\" style=\"color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;\">\r\n\t<tr align=\"center\" valign=\"top\" style=\"color:#C00000;background-color:Tan;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label5\">Header Template Test</span>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label4\">1</span>\n </td>\r\n\t</tr><tr align=\"right\" style=\"color:#FFC0FF;background-color:Tan;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label6\">FormView Footer</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:DarkSlateBlue;background-color:PaleGoldenrod;\">\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView3','Page$2')\" style=\"color:DarkSlateBlue;\">2</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$3')\" style=\"color:DarkSlateBlue;\">3</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$4')\" style=\"color:DarkSlateBlue;\">4</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$5')\" style=\"color:DarkSlateBlue;\">5</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$6')\" style=\"color:DarkSlateBlue;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtmlValue = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" id=\"FormView3\" style=\"color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;\">\r\n\t<tr align=\"center\" valign=\"top\" style=\"color:#C00000;background-color:Tan;font-weight:bold;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label5\">Header Template Test</span>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label4\">1</span>\n </td>\r\n\t</tr><tr align=\"right\" style=\"color:#FFC0FF;background-color:Tan;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView3_Label6\">FormView Footer</span>\n </td>\r\n\t</tr><tr align=\"center\" style=\"color:DarkSlateBlue;background-color:PaleGoldenrod;\">\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView3','Page$2')\" style=\"color:DarkSlateBlue;\">2</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$3')\" style=\"color:DarkSlateBlue;\">3</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$4')\" style=\"color:DarkSlateBlue;\">4</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$5')\" style=\"color:DarkSlateBlue;\">5</a></td><td><a href=\"javascript:__doPostBack('FormView3','Page$6')\" style=\"color:DarkSlateBlue;\">6</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, "RenderingDefaultPaging");
|
||||
}
|
||||
|
||||
@@ -1621,7 +1637,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
WebTest t = new WebTest ("FormViewInsertEditDelete.aspx");
|
||||
string pageHTML = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Chand</span>\n <span id=\"FormView1_FName\">Mahesh</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Chand</span>\n <span id=\"FormView1_FName\">Mahesh</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "BeforeEditPostback");
|
||||
|
||||
//Edit button postback (change to edit mode - buttons "Update" and "Cancel" should appear.
|
||||
@@ -1634,7 +1654,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n Enter First Name:<input name=\"FormView1$FNameEdit\" type=\"text\" value=\"Mahesh\" id=\"FormView1_FNameEdit\" /><br />\n Enter Last Name:<input name=\"FormView1$LNameEdit\" type=\"text\" value=\"Chand\" id=\"FormView1_LNameEdit\" /><br />\n <a id=\"FormView1_UpdateButton\" href=\"javascript:__doPostBack('FormView1$UpdateButton','')\">Update</a>\n <a id=\"FormView1_CancelUpdateButton\" href=\"javascript:__doPostBack('FormView1$CancelUpdateButton','')\">Cancel</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n Enter First Name:<input name=\"FormView1$FNameEdit\" type=\"text\" value=\"Mahesh\" id=\"FormView1_FNameEdit\" /><br />\n Enter Last Name:<input name=\"FormView1$LNameEdit\" type=\"text\" value=\"Chand\" id=\"FormView1_LNameEdit\" /><br />\n <a id=\"FormView1_UpdateButton\" href=\"javascript:__doPostBack('FormView1$UpdateButton','')\">Update</a>\n <a id=\"FormView1_CancelUpdateButton\" href=\"javascript:__doPostBack('FormView1$CancelUpdateButton','')\">Cancel</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterEditPostback");
|
||||
|
||||
//Update record postback
|
||||
@@ -1651,7 +1675,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Test</span>\n <span id=\"FormView1_FName\">Merav</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Test</span>\n <span id=\"FormView1_FName\">Merav</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "AfterUpdatePostback");
|
||||
|
||||
//Postback to return to Edit mode
|
||||
@@ -1679,15 +1707,22 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Test</span>\n <span id=\"FormView1_FName\">Merav</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table>\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_ID\">1001</span> \n <span id=\"FormView1_LName\">Test</span>\n <span id=\"FormView1_FName\">Merav</span> \n <a id=\"FormView1_EditButton\" href=\"javascript:__doPostBack('FormView1$EditButton','')\">Edit</a>\n <a id=\"FormView1_NewButton\" href=\"javascript:__doPostBack('FormView1$NewButton','')\">New</a>\n <a id=\"FormView1_DeleteButton\" href=\"javascript:__doPostBack('FormView1$DeleteButton','')\">Delete</a>\n </td>\r\n\t</tr><tr>\r\n\t\t<td colspan=\"2\"><table border=\"0\">\r\n\t\t\t<tr>\r\n\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('FormView1','Page$2')\">2</a></td><td><a href=\"javascript:__doPostBack('FormView1','Page$3')\">3</a></td>\r\n\t\t\t</tr>\r\n\t\t</table></td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "CancelEditedRecordPostback");
|
||||
}
|
||||
|
||||
[Test (Description="Bug #578863")]
|
||||
public void FormView_PagerSettings_Visibility ()
|
||||
{
|
||||
#if NET_4_0
|
||||
string origHtml = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_Label1\">1</span>\n\t</td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtml = "<table cellspacing=\"2\" cellpadding=\"3\" rules=\"all\" border=\"1\" id=\"FormView1\" style=\"background-color:#DEBA84;border-color:#DEBA84;border-width:1px;border-style:None;\">\r\n\t<tr style=\"color:#8C4510;background-color:#FFF7E7;\">\r\n\t\t<td colspan=\"2\">\n <span id=\"FormView1_Label1\">1</span>\n\t</td>\r\n\t</tr>\r\n</table>";
|
||||
|
||||
#endif
|
||||
WebTest t = new WebTest ("FormViewPagerVisibility.aspx");
|
||||
string pageHtml = t.Run ();
|
||||
string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
|
||||
@@ -2123,7 +2158,11 @@ CommandEventArgs cargs = new CommandEventArgs ("Page", "Prev");
|
||||
t.Request = fr;
|
||||
pageHTML = t.Run ();
|
||||
string newHtml = HtmlDiff.GetControlFromPageHtml (pageHTML);
|
||||
#if NET_4_0
|
||||
string origHtml = "<table cellspacing=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n Insert ID:\n <input name=\"FormView1$IDInsert\" type=\"text\" id=\"FormView1_IDInsert\" /><br />\n Insert First Name:\n <input name=\"FormView1$FNameInsert\" type=\"text\" id=\"FormView1_FNameInsert\" />\n <br />\n Insert Last Name: \n <input name=\"FormView1$LNameInsert\" type=\"text\" id=\"FormView1_LNameInsert\" />\n <a id=\"FormView1_InsertButton\" href=\"javascript:__doPostBack('FormView1$InsertButton','')\">Insert</a>\n <a id=\"FormView1_CancelInsertButton\" href=\"javascript:__doPostBack('FormView1$CancelInsertButton','')\">Cancel</a>\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#else
|
||||
string origHtml = "<table cellspacing=\"0\" border=\"0\" id=\"FormView1\" style=\"border-collapse:collapse;\">\r\n\t<tr>\r\n\t\t<td colspan=\"2\">\n Insert ID:\n <input name=\"FormView1$IDInsert\" type=\"text\" id=\"FormView1_IDInsert\" /><br />\n Insert First Name:\n <input name=\"FormView1$FNameInsert\" type=\"text\" id=\"FormView1_FNameInsert\" />\n <br />\n Insert Last Name: \n <input name=\"FormView1$LNameInsert\" type=\"text\" id=\"FormView1_LNameInsert\" />\n <a id=\"FormView1_InsertButton\" href=\"javascript:__doPostBack('FormView1$InsertButton','')\">Insert</a>\n <a id=\"FormView1_CancelInsertButton\" href=\"javascript:__doPostBack('FormView1$CancelInsertButton','')\">Cancel</a>\n </td>\r\n\t</tr>\r\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (origHtml, newHtml, "InsertPostback");
|
||||
|
||||
//Insert new record
|
||||
|
||||
@@ -592,7 +592,39 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
g.UseAccessibleHeader = false;
|
||||
Assert.AreEqual (false, g.UseAccessibleHeader, "UseAccessibleHeader");
|
||||
}
|
||||
#if NET_4_0
|
||||
[Test]
|
||||
public void SortedAscendingCellStyle ()
|
||||
{
|
||||
var g = new PokerGridView ();
|
||||
|
||||
Assert.IsNotNull (g.SortedAscendingCellStyle, "#A1-1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SortedAscendingHeaderStyle ()
|
||||
{
|
||||
var g = new PokerGridView ();
|
||||
|
||||
Assert.IsNotNull (g.SortedAscendingHeaderStyle, "#A1-1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SortedDescendingCellStyle ()
|
||||
{
|
||||
var g = new PokerGridView ();
|
||||
|
||||
Assert.IsNotNull (g.SortedDescendingCellStyle, "#A1-1");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void SortedDescendingHeaderStyle ()
|
||||
{
|
||||
var g = new PokerGridView ();
|
||||
|
||||
Assert.IsNotNull (g.SortedDescendingHeaderStyle, "#A1-1");
|
||||
}
|
||||
#endif
|
||||
[Test]
|
||||
public void GridView_DefaultProtectedProperties ()
|
||||
{
|
||||
@@ -1565,7 +1597,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderAllowPaging)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Item</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Item</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><span>1</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$2')\">2</a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderDefault");
|
||||
}
|
||||
|
||||
@@ -1594,7 +1630,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderAllowPaging2)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Item</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>France</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Italy</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><table>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Page$1')\">1</a></td><td><span>2</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$3')\">3</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$4')\">4</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$5')\">...</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$Last')\">>></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">Item</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>France</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Italy</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><table border=\"0\">\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Page$1')\">1</a></td><td><span>2</span></td><td><a href=\"javascript:__doPostBack('ctl01','Page$3')\">3</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$4')\">4</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$5')\">...</a></td><td><a href=\"javascript:__doPostBack('ctl01','Page$Last')\">>></a></td>\r\n\t\t\t\t</tr>\r\n\t\t\t</table></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderDefault");
|
||||
}
|
||||
|
||||
@@ -1633,7 +1673,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderProperty)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div id=\"__gvctl01__div\">\r\n\t<table cellspacing=\"1\" cellpadding=\"0\" align=\"Justify\" rules=\"rows\" border=\"1\" style=\"background-image:url(http://test);\">\r\n\t\t<caption align=\"Left\">\r\n\t\t\ttest\r\n\t\t</caption><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$0')\">Delete</a></td><td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$1')\">Delete</a></td><td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$2')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$2')\">Delete</a></td><td>France</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$3')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$3')\">Delete</a></td><td>Italy</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td> </td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div id=\"__gvctl01__div\">\r\n\t<table cellspacing=\"1\" cellpadding=\"0\" align=\"Justify\" rules=\"rows\" border=\"1\" style=\"background-image:url(http://test);\">\r\n\t\t<caption align=\"Left\">\r\n\t\t\ttest\r\n\t\t</caption><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$0')\">Delete</a></td><td>Norway</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$1')\">Delete</a></td><td>Sweden</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$2')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$2')\">Delete</a></td><td>France</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$3')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$3')\">Delete</a></td><td>Italy</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td> </td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderDefault");
|
||||
}
|
||||
|
||||
@@ -1695,7 +1739,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingCheckBoxField)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span class=\"aspNetDisabled\"><input id=\"ctl01_ctl00_0\" type=\"checkbox\" name=\"ctl01$ctl02$ctl00\" checked=\"checked\" disabled=\"disabled\" /></span></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span class=\"aspNetDisabled\"><input id=\"ctl01_ctl00_1\" type=\"checkbox\" name=\"ctl01$ctl03$ctl00\" disabled=\"disabled\" /></span></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span disabled=\"disabled\"><input id=\"ctl01_ctl02_ctl00\" type=\"checkbox\" name=\"ctl01$ctl02$ctl00\" checked=\"checked\" disabled=\"disabled\" /></span></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span disabled=\"disabled\"><input id=\"ctl01_ctl03_ctl00\" type=\"checkbox\" name=\"ctl01$ctl03$ctl00\" disabled=\"disabled\" /></span></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingCheckBoxField");
|
||||
}
|
||||
|
||||
@@ -1704,7 +1752,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingCheckBoxField2)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">bool</th><th scope=\"col\">str</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span class=\"aspNetDisabled\" title=\"bool\"><input id=\"ctl01_ctl00_0\" type=\"checkbox\" name=\"ctl01$ctl02$ctl00\" checked=\"checked\" disabled=\"disabled\" /></span></td><td>1</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span class=\"aspNetDisabled\" title=\"bool\"><input id=\"ctl01_ctl00_1\" type=\"checkbox\" name=\"ctl01$ctl03$ctl00\" disabled=\"disabled\" /></span></td><td>2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td> </td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">bool</th><th scope=\"col\">str</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span disabled=\"disabled\" title=\"bool\"><input id=\"ctl01_ctl02_ctl00\" type=\"checkbox\" name=\"ctl01$ctl02$ctl00\" checked=\"checked\" disabled=\"disabled\" /></span></td><td>1</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><span disabled=\"disabled\" title=\"bool\"><input id=\"ctl01_ctl03_ctl00\" type=\"checkbox\" name=\"ctl01$ctl03$ctl00\" disabled=\"disabled\" /></span></td><td>2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td> </td><td> </td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingCheckBoxField2");
|
||||
}
|
||||
|
||||
@@ -1713,7 +1765,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingImageField)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"1\" alt=\"1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"2\" alt=\"2\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"1\" alt=\"1\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><img src=\"2\" alt=\"2\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingImageField");
|
||||
}
|
||||
|
||||
@@ -1722,7 +1778,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingCommandField)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('ctl01','New$0')\">New</a> <a href=\"javascript:__doPostBack('ctl01','Select$0')\">Select</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$1')\">Delete</a> <a href=\"javascript:__doPostBack('ctl01','New$1')\">New</a> <a href=\"javascript:__doPostBack('ctl01','Select$1')\">Select</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$0')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$0')\">Delete</a> <a href=\"javascript:__doPostBack('ctl01','New$0')\">New</a> <a href=\"javascript:__doPostBack('ctl01','Select$0')\">Select</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><a href=\"javascript:__doPostBack('ctl01','Edit$1')\">Edit</a> <a href=\"javascript:__doPostBack('ctl01','Delete$1')\">Delete</a> <a href=\"javascript:__doPostBack('ctl01','New$1')\">New</a> <a href=\"javascript:__doPostBack('ctl01','Select$1')\">Select</a></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingCommandField");
|
||||
}
|
||||
|
||||
@@ -1740,7 +1800,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingButtonField)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th><th scope=\"col\">HeaderText</th><th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input type=\"button\" value=\"1\" onclick=\"javascript:__doPostBack('ctl01','$0')\" /></td><td><a href=\"javascript:__doPostBack('ctl01','cmd2$0')\">1</a></td><td><input type=\"image\" src=\"\" alt=\"1\" onclick=\"javascript:__doPostBack('ctl01','cmd3$0');return false;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input type=\"button\" value=\"2\" onclick=\"javascript:__doPostBack('ctl01','$1')\" /></td><td><a href=\"javascript:__doPostBack('ctl01','cmd2$1')\">2</a></td><td><input type=\"image\" src=\"\" alt=\"2\" onclick=\"javascript:__doPostBack('ctl01','cmd3$1');return false;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td><td>FooterText</td><td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">HeaderText</th><th scope=\"col\">HeaderText</th><th scope=\"col\">HeaderText</th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input type=\"button\" value=\"1\" onclick=\"javascript:__doPostBack('ctl01','$0')\" /></td><td><a href=\"javascript:__doPostBack('ctl01','cmd2$0')\">1</a></td><td><input type=\"image\" src=\"\" alt=\"1\" onclick=\"javascript:__doPostBack('ctl01','cmd3$0')\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input type=\"button\" value=\"2\" onclick=\"javascript:__doPostBack('ctl01','$1')\" /></td><td><a href=\"javascript:__doPostBack('ctl01','cmd2$1')\">2</a></td><td><input type=\"image\" src=\"\" alt=\"2\" onclick=\"javascript:__doPostBack('ctl01','cmd3$1')\" style=\"border-width:0px;\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>FooterText</td><td>FooterText</td><td>FooterText</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingButtonField");
|
||||
}
|
||||
|
||||
@@ -1757,10 +1821,13 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
[Test]
|
||||
public void GridView_RenderingTemplateField ()
|
||||
{
|
||||
|
||||
string RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (RenderingTemplateField)).Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"grid\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\"><input name=\"grid$ctl01$TextBox1\" type=\"text\" id=\"grid_TextBox1\" /></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl02$TextBox1\" type=\"text\" value=\"1\" id=\"grid_TextBox1_0\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl03$TextBox1\" type=\"text\" value=\"2\" id=\"grid_TextBox1_1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl04$TextBox1\" type=\"text\" id=\"grid_TextBox1\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string OriginControlHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"grid\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\"><input name=\"grid$ctl01$TextBox1\" type=\"text\" id=\"grid_ctl01_TextBox1\" /></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl02$TextBox1\" type=\"text\" value=\"1\" id=\"grid_ctl02_TextBox1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl03$TextBox1\" type=\"text\" value=\"2\" id=\"grid_ctl03_TextBox1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td><input name=\"grid$ctl04$TextBox1\" type=\"text\" id=\"grid_ctl04_TextBox1\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "RenderingTemplateField");
|
||||
}
|
||||
|
||||
|
||||
@@ -134,8 +134,13 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
public void ImageMap_Defaults_Render ()
|
||||
{
|
||||
PokerImageMap imageMap = new PokerImageMap ();
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img src=\"\" />";
|
||||
#else
|
||||
string originalHtml = "<img src=\"\" style=\"border-width:0px;\" />";
|
||||
HtmlDiff.AssertAreEqual (imageMap.Render (), originalHtml, "RenderDefault");
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDefault");
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -150,7 +155,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
CircleHotSpot circle = new CircleHotSpot ();
|
||||
circle.NavigateUrl = "NavigateURL";
|
||||
imageMap.HotSpots.Add (circle);
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#else
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateTextAssigned");
|
||||
}
|
||||
@@ -172,7 +181,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
circle.X = 30;
|
||||
circle.Y = 40;
|
||||
imageMap.HotSpots.Add (circle);
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"30,40,10\" href=\"NavigateURL\" title=\"Circle\" alt=\"Circle\" accesskey=\"A\" tabindex=\"1\" />\r\n</map>";
|
||||
#else
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"30,40,10\" href=\"NavigateURL\" title=\"Circle\" alt=\"Circle\" accesskey=\"A\" tabindex=\"1\" />\r\n</map>";
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateCircleTextAssigned");
|
||||
}
|
||||
@@ -204,7 +217,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
poly.TabIndex = 2;
|
||||
poly.Coordinates = "10,20,30,40,50,60,100,200";
|
||||
imageMap.HotSpots.Add (poly);
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"rect\" coords=\"30,20,40,10\" href=\"NavigateUrlRect\" title=\"Rectangle\" alt=\"Rectangle\" accesskey=\"R\" tabindex=\"1\" /><area shape=\"poly\" coords=\"10,20,30,40,50,60,100,200\" href=\"NavigateUrlPoly\" title=\"Polygon\" alt=\"Polygon\" accesskey=\"P\" tabindex=\"2\" />\r\n</map>";
|
||||
#else
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"rect\" coords=\"30,20,40,10\" href=\"NavigateUrlRect\" title=\"Rectangle\" alt=\"Rectangle\" accesskey=\"R\" tabindex=\"1\" /><area shape=\"poly\" coords=\"10,20,30,40,50,60,100,200\" href=\"NavigateUrlPoly\" title=\"Polygon\" alt=\"Polygon\" accesskey=\"P\" tabindex=\"2\" />\r\n</map>";
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderNavigateShapesTextAssigned");
|
||||
}
|
||||
@@ -219,7 +236,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
imageMap.HotSpotMode = HotSpotMode.Inactive;
|
||||
imageMap.Target = "Target";
|
||||
imageMap.HotSpots.Add (new CircleHotSpot ());
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" nohref=\"true\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#else
|
||||
string originalHtml = "<img src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" nohref=\"true\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderInaciveTextAssigned");
|
||||
}
|
||||
@@ -236,8 +257,15 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
CircleHotSpot circle = new CircleHotSpot ();
|
||||
circle.NavigateUrl = "NavigateURL";
|
||||
imageMap.HotSpots.Add (circle);
|
||||
#if NET_4_0
|
||||
string originalHtml = "<img class=\"aspNetDisabled\" src=\"\" usemap=\"#ImageMap\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#else
|
||||
string originalHtml = "<img disabled=\"disabled\" src=\"\" usemap=\"#ImageMap\" style=\"border-width:0px;\" /><map name=\"ImageMap\" id=\"ImageMap\">\r\n\t<area shape=\"circle\" coords=\"0,0,0\" href=\"NavigateURL\" target=\"Target\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#endif
|
||||
string renderedHtml = imageMap.Render ();
|
||||
Console.WriteLine (renderedHtml);
|
||||
Console.WriteLine ("-----------");
|
||||
Console.WriteLine (originalHtml);
|
||||
HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "RenderDisabledTextAssigne");
|
||||
}
|
||||
|
||||
@@ -446,7 +474,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
{
|
||||
WebTest t = new WebTest (PageInvoker.CreateOnLoad (myPageLoad));
|
||||
#region orig
|
||||
#if NET_4_0
|
||||
string strTarget = "<img id=\"imgmap\" src=\"\" usemap=\"#ImageMapimgmap\" /><map name=\"ImageMapimgmap\" id=\"ImageMapimgmap\">\r\n\t<area shape=\"rect\" coords=\"0,0,0,0\" href=\"javascript:__doPostBack('imgmap','0')\" title=\"\" alt=\"\" /><area shape=\"poly\" coords=\"\" href=\"javascript:__doPostBack('imgmap','1')\" title=\"\" alt=\"\" /><area shape=\"circle\" coords=\"0,0,0\" href=\"javascript:__doPostBack('imgmap','2')\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#else
|
||||
string strTarget = "<img id=\"imgmap\" src=\"\" usemap=\"#ImageMapimgmap\" style=\"border-width:0px;\" /><map name=\"ImageMapimgmap\" id=\"ImageMapimgmap\">\r\n\t<area shape=\"rect\" coords=\"0,0,0,0\" href=\"javascript:__doPostBack('imgmap','0')\" title=\"\" alt=\"\" /><area shape=\"poly\" coords=\"\" href=\"javascript:__doPostBack('imgmap','1')\" title=\"\" alt=\"\" /><area shape=\"circle\" coords=\"0,0,0\" href=\"javascript:__doPostBack('imgmap','2')\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#endif
|
||||
#endregion
|
||||
string RenderedPageHtml = t.Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
@@ -466,7 +498,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
fr.Controls["__EVENTARGUMENT"].Value = "0";
|
||||
t.Request = fr;
|
||||
#region orig
|
||||
#if NET_4_0
|
||||
string strTarget = "<img id=\"imgmap\" src=\"\" usemap=\"#ImageMapimgmap\" /><map name=\"ImageMapimgmap\" id=\"ImageMapimgmap\">\r\n\t<area shape=\"rect\" coords=\"0,0,0,0\" href=\"javascript:__doPostBack('imgmap','0')\" title=\"\" alt=\"\" /><area shape=\"poly\" coords=\"\" href=\"javascript:__doPostBack('imgmap','1')\" title=\"\" alt=\"\" /><area shape=\"circle\" coords=\"0,0,0\" href=\"javascript:__doPostBack('imgmap','2')\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#else
|
||||
string strTarget = "<img id=\"imgmap\" src=\"\" usemap=\"#ImageMapimgmap\" style=\"border-width:0px;\" /><map name=\"ImageMapimgmap\" id=\"ImageMapimgmap\">\r\n\t<area shape=\"rect\" coords=\"0,0,0,0\" href=\"javascript:__doPostBack('imgmap','0')\" title=\"\" alt=\"\" /><area shape=\"poly\" coords=\"\" href=\"javascript:__doPostBack('imgmap','1')\" title=\"\" alt=\"\" /><area shape=\"circle\" coords=\"0,0,0\" href=\"javascript:__doPostBack('imgmap','2')\" title=\"\" alt=\"\" />\r\n</map>";
|
||||
#endif
|
||||
#endregion
|
||||
string RenderedPageHtml = t.Run ();
|
||||
string RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
|
||||
@@ -171,7 +171,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
Assert.IsNotNull (p.StaticMenuStyle, "StaticMenuStyle");
|
||||
Assert.AreEqual ("", p.StaticPopOutImageUrl, "StaticPopOutImageUrl");
|
||||
Assert.IsNotNull (p.StaticSelectedStyle, "StaticSelectedStyle");
|
||||
#if NET_4_0
|
||||
Assert.IsTrue (p.StaticSubMenuIndent.IsEmpty, "StaticSubMenuIndent");
|
||||
#else
|
||||
Assert.AreEqual (Unit.Pixel(16), p.StaticSubMenuIndent, "StaticSubMenuIndent");
|
||||
#endif
|
||||
Assert.AreEqual ("", p.StaticTopSeparatorImageUrl, "StaticTopSeparatorImageUrl");
|
||||
Assert.AreEqual ("", p.Target, "Target");
|
||||
Assert.IsNotNull (p.OnTagKey (), "TagKey");
|
||||
@@ -404,7 +408,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
HtmlTextWriter tw = new HtmlTextWriter (sw);
|
||||
pm.RenderBeginTag (tw);
|
||||
string RenderedControlHtml = sw.ToString();
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&t=634067491135766272\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"ctl01\">\r\n";
|
||||
#else
|
||||
string OriginControlHtml = "<a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/NunitWeb/WebResource.axd?d=4RHYfeNnynkXiM59uthjZg2&t=633802729995006876\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><table id=\"ctl01\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual(OriginControlHtml,RenderedControlHtml,"RenderBeginTag");
|
||||
}
|
||||
@@ -424,7 +432,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
pm.RenderBeginTag (tw);
|
||||
pm.RenderEndTag (tw);
|
||||
string RenderedControlHtml = sw.ToString ();
|
||||
#if NET_4_0
|
||||
string OriginControlHtml = "<a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&t=634067491135766272\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"ctl01\">\r\n\r\n</div><a id=\"ctl01_SkipLink\"></a>";
|
||||
#else
|
||||
string OriginControlHtml = "<a href=\"#ctl01_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/NunitWeb/WebResource.axd?d=4RHYfeNnynkXiM59uthjZg2&t=633802729995006876\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><table id=\"ctl01\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\r\n\r\n</table><a id=\"ctl01_SkipLink\"></a>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual(OriginControlHtml, RenderedControlHtml,"RenderEndTag");
|
||||
}
|
||||
@@ -879,6 +891,9 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
public void Menu_RenderStaticItems () {
|
||||
string RenderedPageHtml, RenderedControlHtml, OriginControlHtml;
|
||||
#region OriginControlHtml
|
||||
#if NET_4_0
|
||||
OriginControlHtml = "<a href=\"#Menu_SkipLink\"><img alt=\"Skip Navigation Links\" src=\"/NunitWeb/WebResource.axd?d=8VpphgAbakKUC_J8R6hR0Q2&t=634067491135766272\" width=\"0\" height=\"0\" style=\"border-width:0px;\" /></a><div id=\"Menu\">\r\n\t<ul class=\"level1\">\r\n\t\t<li><a class=\"level1\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value')\">one-black</a></li><li><a class=\"level2\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value')\">two-black-1</a></li><li><a class=\"level3\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-1-value')\">three-black-1</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-1-value\\\\four-black-1-value')\">four-black-1</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-1-value\\\\four-black-2-value')\">four-black-2</a></li><li><a class=\"level3\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-2-value')\">three-black-2</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-2-value\\\\four-black-3-value')\">four-black-3</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-1-value\\\\three-black-2-value\\\\four-black-4-value')\">four-black-4</a></li><li><a class=\"level2\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value')\">two-black-2</a></li><li><a class=\"level3\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-3-value')\">three-black-3</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-3-value\\\\four-black-5-value')\">four-black-5</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-3-value\\\\four-black-6-value')\">four-black-6</a></li><li><a class=\"level3\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-4-value')\">three-black-4</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-4-value\\\\four-black-7-value')\">four-black-7</a></li><li><a class=\"level4\" href=\"#\" onclick=\"__doPostBack('Menu','one-black-value\\\\two-black-2-value\\\\three-black-4-value\\\\four-black-8-value')\">four-black-8</a></li>\r\n\t</ul>\r\n</div><a id=\"Menu_SkipLink\"></a>";
|
||||
#else
|
||||
OriginControlHtml = @"<a href=""#Menu_SkipLink""><img alt=""Skip Navigation Links"" src=""/NunitWeb/WebResource.axd?d=QxfUEifeQdL5PTiZOF8HlA2&t=632900536532114160"" width=""0"" height=""0"" style=""border-width:0px;"" /></a><table id=""Menu"" class=""Menu_2"" cellpadding=""0"" cellspacing=""0"" border=""0"">
|
||||
<tr onmouseover=""Menu_HoverRoot(this)"" onmouseout=""Menu_Unhover(this)"" onkeyup=""Menu_Key(this)"" id=""Menun0"">
|
||||
<td><table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"">
|
||||
@@ -1000,6 +1015,7 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
</table></td>
|
||||
</tr>
|
||||
</table><a id=""Menu_SkipLink""></a>";
|
||||
#endif
|
||||
#endregion
|
||||
RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Vertical)).Run ();
|
||||
RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
@@ -1009,6 +1025,9 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
HtmlDiff.AssertAreEqual (OriginControlHtml, RenderedControlHtml, "Menu_RenderStaticItemsWithDefaultAdapter_Vertical");
|
||||
|
||||
#region OriginControlHtml
|
||||
#if NET_4_0
|
||||
OriginControlHtml = "";
|
||||
#else
|
||||
OriginControlHtml = @"<a href=""#Menu_SkipLink""><img alt=""Skip Navigation Links"" src=""/NunitWeb/WebResource.axd?d=QxfUEifeQdL5PTiZOF8HlA2&t=632900536532114160"" width=""0"" height=""0"" style=""border-width:0px;"" /></a><table id=""Menu"" class=""Menu_2"" cellpadding=""0"" cellspacing=""0"" border=""0"">
|
||||
<tr>
|
||||
<td onmouseover=""Menu_HoverRoot(this)"" onmouseout=""Menu_Unhover(this)"" onkeyup=""Menu_Key(this)"" id=""Menun0""><table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"">
|
||||
@@ -1102,6 +1121,7 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
</table></td>
|
||||
</tr>
|
||||
</table><a id=""Menu_SkipLink""></a>";
|
||||
#endif
|
||||
#endregion
|
||||
RenderedPageHtml = new WebTest (PageInvoker.CreateOnLoad (Menu_RenderStaticItems_Horizontal)).Run ();
|
||||
RenderedControlHtml = HtmlDiff.GetControlFromPageHtml (RenderedPageHtml);
|
||||
@@ -1583,7 +1603,11 @@ namespace MonoTests.System.Web.UI.WebControls
|
||||
public void MenuClass ()
|
||||
{
|
||||
string res = new WebTest ("menuclass.aspx").Run ();
|
||||
#if NET_4_0
|
||||
string menua_pattern="<div[^>]*class=\"[^\"]*menua[^\"]*\"[^>]*>";
|
||||
#else
|
||||
string menua_pattern="<table[^>]*class=\"[^\"]*menua[^\"]*\"[^>]*>";
|
||||
#endif
|
||||
Assert.IsTrue (Regex.IsMatch (res, ".*"+menua_pattern+".*",
|
||||
RegexOptions.IgnoreCase|RegexOptions.Singleline),
|
||||
"check that <table class=\"menua\"> is found");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if NET_2_0
|
||||
#if NET_2_0 && !NET_4_0
|
||||
|
||||
// THIS IS AUTOGENERATED DO NOT EDIT
|
||||
//
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -153,7 +153,8 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
HtmlTextWriter writer = GetWriter ();
|
||||
ri.RenderRepeater (writer, new RepeatInfoUser (false, false, false, 1), new TableStyle (), wc);
|
||||
Assert.AreEqual (s, writer.InnerWriter.ToString (), msg);
|
||||
string rendered = writer.InnerWriter.ToString ();
|
||||
Assert.AreEqual (s, rendered, msg);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -166,12 +167,12 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
[Test]
|
||||
public void RenderRepeater_BaseControl ()
|
||||
{
|
||||
#if NET_2_0
|
||||
#if NET_4_0
|
||||
string noid = "<table>\n\t<tr>\n\t\t<td>0</td><td></td><td></td>\n\t</tr>\n</table>";
|
||||
string id_enabled = "<table id=\"foo\" class=\"aspNetDisabled\">\n\t<tr>\n\t\t<td>0</td><td></td><td></td>\n\t</tr>\n</table>";
|
||||
#else
|
||||
string noid = "<table border=\"0\">\n\t<tr>\n\t\t<td>0</td><td></td><td></td>\n\t</tr>\n</table>";
|
||||
string id_enabled = "<table id=\"foo\" disabled=\"disabled\" border=\"0\">\n\t<tr>\n\t\t<td>0</td><td></td><td></td>\n\t</tr>\n</table>";
|
||||
#else
|
||||
string noid = "<table border=\"0\">\n\t<tr>\n\t\t<td>0</td>\n\t</tr>\n</table>";
|
||||
string id_enabled = "<table id=\"foo\" disabled=\"disabled\" border=\"0\">\n\t<tr>\n\t\t<td>0</td>\n\t</tr>\n</table>";
|
||||
#endif
|
||||
RenderRepeater_BaseControl (noid, "Table", new Table ());
|
||||
RenderRepeater_BaseControl (noid, "DataList", new DataList ());
|
||||
|
||||
@@ -110,10 +110,10 @@ class X {
|
||||
|
||||
static void Main ()
|
||||
{
|
||||
#if NET_2_0
|
||||
Console.WriteLine ("#if NET_2_0");
|
||||
#if NET_4_0
|
||||
Console.WriteLine ("#if NET_4_0");
|
||||
#else
|
||||
Console.WriteLine ("#if !NET_2_0");
|
||||
Console.WriteLine ("#if NET_2_0 && !NET_4_0");
|
||||
#endif
|
||||
|
||||
Console.WriteLine (@"
|
||||
|
||||
@@ -117,7 +117,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
TestTable t = new TestTable ();
|
||||
t.Caption = "CaptionText";
|
||||
string html = t.Render ();
|
||||
#if NET_4_0
|
||||
string orig = "<table>\n\t<caption>\n\t\tCaptionText\n\t</caption>\n</table>";
|
||||
#else
|
||||
string orig = "<table border=\"0\">\n\t<caption>\n\t\tCaptionText\n\t</caption>\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (orig, html, "Caption");
|
||||
}
|
||||
|
||||
@@ -128,7 +132,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Caption = "CaptionText";
|
||||
t.CaptionAlign = TableCaptionAlign.Left;
|
||||
string html = t.Render ();
|
||||
#if NET_4_0
|
||||
string orig = "<table>\n\t<caption align=\"Left\">\n\t\tCaptionText\n\t</caption>\n</table>";
|
||||
#else
|
||||
string orig = "<table border=\"0\">\n\t<caption align=\"Left\">\n\t\tCaptionText\n\t</caption>\n</table>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (orig, html, "CaptionAlign");
|
||||
}
|
||||
#endif
|
||||
@@ -249,16 +257,28 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
{
|
||||
TestTable t = new TestTable ();
|
||||
string s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\n</table>", s, "empty/default");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\n</table>", s, "empty/default");
|
||||
#endif
|
||||
|
||||
t.CellPadding = 1;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table cellpadding=\"1\">\n\n</table>", s, "CellPadding");
|
||||
#else
|
||||
Assert.AreEqual ("<table cellpadding=\"1\" border=\"0\">\n\n</table>", s, "CellPadding");
|
||||
#endif
|
||||
t.CellPadding = -1;
|
||||
|
||||
t.CellSpacing = 2;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table cellspacing=\"2\">\n\n</table>", s, "CellSpacing");
|
||||
#else
|
||||
Assert.AreEqual ("<table cellspacing=\"2\" border=\"0\">\n\n</table>", s, "CellSpacing");
|
||||
#endif
|
||||
t.CellSpacing = -1;
|
||||
|
||||
t.GridLines = GridLines.Horizontal;
|
||||
@@ -274,60 +294,125 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
|
||||
t.BorderWidth = new Unit (2);
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.IsTrue ((s.IndexOf ("\"border-width:2px;border-style:solid;\"") > 0), "border=0/2");
|
||||
#else
|
||||
Assert.IsTrue ((s.IndexOf ("border=\"0\"") > 0), "border=0/2");
|
||||
#endif
|
||||
t.GridLines = GridLines.Horizontal;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Console.WriteLine (s);
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"rows\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Horizontal");
|
||||
#else
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"rows\" border=\"2\"") > 0), "2/GridLines.Horizontal");
|
||||
#endif
|
||||
t.GridLines = GridLines.Vertical;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"cols\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Vertical");
|
||||
#else
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"cols\" border=\"2\"") > 0), "2/GridLines.Vertical");
|
||||
#endif
|
||||
t.GridLines = GridLines.Both;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"all\" style=\"border-width:2px;border-style:solid;\"") > 0), "2/GridLines.Both");
|
||||
#else
|
||||
Assert.IsTrue ((s.IndexOf ("rules=\"all\" border=\"2\"") > 0), "2/GridLines.Both");
|
||||
#endif
|
||||
t.GridLines = GridLines.None;
|
||||
t.BorderWidth = new Unit ();
|
||||
|
||||
t.HorizontalAlign = HorizontalAlign.Left;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table align=\"left\">\n\n</table>", s.ToLower (), "HorizontalAlign.Left");
|
||||
#else
|
||||
Assert.AreEqual ("<table align=\"left\" border=\"0\">\n\n</table>", s.ToLower (), "HorizontalAlign.Left");
|
||||
#endif
|
||||
t.HorizontalAlign = HorizontalAlign.Center;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table align=\"center\">\n\n</table>", s.ToLower (), "HorizontalAlign.Center");
|
||||
#else
|
||||
Assert.AreEqual ("<table align=\"center\" border=\"0\">\n\n</table>", s.ToLower (), "HorizontalAlign.Center");
|
||||
#endif
|
||||
t.HorizontalAlign = HorizontalAlign.Right;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table align=\"right\">\n\n</table>", s.ToLower (), "HorizontalAlign.Right");
|
||||
#else
|
||||
Assert.AreEqual ("<table align=\"right\" border=\"0\">\n\n</table>", s.ToLower (), "HorizontalAlign.Right");
|
||||
#endif
|
||||
t.HorizontalAlign = HorizontalAlign.Justify;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table align=\"justify\">\n\n</table>", s.ToLower (), "HorizontalAlign.Justify");
|
||||
#else
|
||||
Assert.AreEqual ("<table align=\"justify\" border=\"0\">\n\n</table>", s.ToLower (), "HorizontalAlign.Justify");
|
||||
#endif
|
||||
t.HorizontalAlign = HorizontalAlign.NotSet;
|
||||
|
||||
t.Caption = "mono";
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption>\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption>\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption");
|
||||
#endif
|
||||
|
||||
t.CaptionAlign = TableCaptionAlign.Top;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption align=\"top\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Top");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption align=\"top\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Top");
|
||||
#endif
|
||||
t.CaptionAlign = TableCaptionAlign.Bottom;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption align=\"bottom\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Bottom");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption align=\"bottom\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Bottom");
|
||||
#endif
|
||||
t.CaptionAlign = TableCaptionAlign.Right;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption align=\"right\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Right");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption align=\"right\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Right");
|
||||
#endif
|
||||
t.CaptionAlign = TableCaptionAlign.Left;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption align=\"left\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Left");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption align=\"left\">\n\t\tmono\n\t</caption>\n</table>", s.ToLower (), "Caption/Left");
|
||||
#endif
|
||||
t.Caption = null;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\n</table>", s, "CaptionAlign without Caption");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\n</table>", s, "CaptionAlign without Caption");
|
||||
#endif
|
||||
t.CaptionAlign = TableCaptionAlign.NotSet;
|
||||
|
||||
t.BackImageUrl = imageUrl;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table style=\"background-image:url(http://www.mono-project.com/stylesheets/images.wiki.png);\">\n\n</table>", s, "BackImageUrl");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\" style=\"background-image:url(http://www.mono-project.com/stylesheets/images.wiki.png);\">\n\n</table>", s, "BackImageUrl");
|
||||
#endif
|
||||
t.BackImageUrl = localImageUrl;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table style=\"background-image:url(foo.jpg);\">\n\n</table>", s, "BackImageUrl");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\" style=\"background-image:url(foo.jpg);\">\n\n</table>", s, "BackImageUrl");
|
||||
#endif
|
||||
t.BackImageUrl = String.Empty;
|
||||
}
|
||||
|
||||
@@ -338,7 +423,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
{
|
||||
WebTest t = new WebTest (PageInvoker.CreateOnLoad (RenderInAspxPage_OnLoad));
|
||||
string res = t.Run ();
|
||||
#if NET_4_0
|
||||
Assert.IsTrue (res.IndexOf ("<table id=\"MagicID_A1C3\" style=\"background-image:url(foo.jpg);\"") != -1, res);
|
||||
#else
|
||||
Assert.IsTrue (res.IndexOf ("<table id=\"MagicID_A1C3\" border=\"0\" style=\"background-image:url(foo.jpg);\"")!= -1, res);
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void RenderInAspxPage_OnLoad (Page p)
|
||||
@@ -393,19 +482,31 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
Assert.AreEqual (1, t.Rows.Count, "r1");
|
||||
Assert.AreEqual (1, t.Controls.Count, "c1");
|
||||
string s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<tr>\n\n\t</tr>\n</table>"), Adjust (s), "tr-1");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<tr>\n\n\t</tr>\n</table>"), Adjust (s), "tr-1");
|
||||
#endif
|
||||
|
||||
// change instance properties
|
||||
tr.HorizontalAlign = HorizontalAlign.Justify;
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-1j");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-1j");
|
||||
#endif
|
||||
|
||||
// add it again (same instance)
|
||||
t.Rows.Add (tr);
|
||||
Assert.AreEqual (1, t.Rows.Count, "t1bis");
|
||||
Assert.AreEqual (1, t.Controls.Count, "c1bis");
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-1bis");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-1bis");
|
||||
#endif
|
||||
tr.HorizontalAlign = HorizontalAlign.NotSet;
|
||||
|
||||
tr = new TableRow ();
|
||||
@@ -414,7 +515,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
Assert.AreEqual (2, t.Rows.Count, "r2");
|
||||
Assert.AreEqual (2, t.Controls.Count, "c2");
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-2");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-2");
|
||||
#endif
|
||||
|
||||
tr = new TableRow ();
|
||||
tr.VerticalAlign = VerticalAlign.Bottom;
|
||||
@@ -422,11 +527,19 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
Assert.AreEqual (3, t.Rows.Count, "r3");
|
||||
Assert.AreEqual (3, t.Controls.Count, "c3");
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr><tr valign=\"bottom\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-3");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr><tr valign=\"bottom\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-3");
|
||||
#endif
|
||||
|
||||
t.Caption = "caption";
|
||||
s = t.Render ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual (Adjust ("<table>\n\t<caption>\n\t\tcaption\n\t</caption><tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr><tr valign=\"bottom\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-2c");
|
||||
#else
|
||||
Assert.AreEqual (Adjust ("<table border=\"0\">\n\t<caption>\n\t\tcaption\n\t</caption><tr>\n\n\t</tr><tr align=\"justify\">\n\n\t</tr><tr valign=\"bottom\">\n\n\t</tr>\n</table>"), Adjust (s), "tr-2c");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -515,7 +628,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
Table t = new Table ();
|
||||
t.RenderBeginTag (writer);
|
||||
string s = writer.InnerWriter.ToString ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n", s, "empty");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n", s, "empty");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -526,7 +643,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.CellPadding = 1;
|
||||
t.RenderBeginTag (writer);
|
||||
string s = writer.InnerWriter.ToString ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table cellpadding=\"1\">\n", s, "CellPadding");
|
||||
#else
|
||||
Assert.AreEqual ("<table cellpadding=\"1\" border=\"0\">\n", s, "CellPadding");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -537,7 +658,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Caption = "caption";
|
||||
t.RenderBeginTag (writer);
|
||||
string s = writer.InnerWriter.ToString ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption>\n\t\tcaption\n\t</caption>", s, "caption");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption>\n\t\tcaption\n\t</caption>", s, "caption");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -549,7 +674,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.CaptionAlign = TableCaptionAlign.Top;
|
||||
t.RenderBeginTag (writer);
|
||||
string s = writer.InnerWriter.ToString ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n\t<caption align=\"top\">\n\t\tcaption\n\t</caption>", s.ToLower (), "caption");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n\t<caption align=\"top\">\n\t\tcaption\n\t</caption>", s.ToLower (), "caption");
|
||||
#endif
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -560,7 +689,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.Rows.Add (new TableRow ());
|
||||
t.RenderBeginTag (writer);
|
||||
string s = writer.InnerWriter.ToString ();
|
||||
#if NET_4_0
|
||||
Assert.AreEqual ("<table>\n", s, "tr");
|
||||
#else
|
||||
Assert.AreEqual ("<table border=\"0\">\n", s, "tr");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NET_2_0
|
||||
|
||||
@@ -109,10 +109,10 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
Poker t = new Poker ();
|
||||
t.TextMode = TextBoxMode.MultiLine;
|
||||
t.Text = "</textarea>";
|
||||
#if NET_2_0
|
||||
string exp = "<textarea rows=\"2\" cols=\"20\"></textarea></textarea>";
|
||||
#if NET_4_0
|
||||
string exp = "<textarea rows=\"2\" cols=\"20\">\r\n</textarea></textarea>";
|
||||
#else
|
||||
string exp = "<textarea name></textarea></textarea>";
|
||||
string exp = "<textarea rows=\"2\" cols=\"20\"></textarea></textarea>";
|
||||
#endif
|
||||
|
||||
HtmlDiff.AssertAreEqual(exp, t.Render (),"MultilineRenderEscape");
|
||||
@@ -169,8 +169,11 @@ namespace MonoTests.System.Web.UI.WebControls {
|
||||
t.ValidationGroup = "VG";
|
||||
t.CausesValidation = true;
|
||||
t.TextMode = TextBoxMode.MultiLine;
|
||||
|
||||
#if NET_4_0
|
||||
string exp = "<textarea rows=\"2\" cols=\"20\">\r\n</textarea>";
|
||||
#else
|
||||
string exp = "<textarea rows=\"2\" cols=\"20\"></textarea>";
|
||||
#endif
|
||||
HtmlDiff.AssertAreEqual (exp, t.Render (),"ValidationRender");
|
||||
}
|
||||
|
||||
|
||||
@@ -53,20 +53,25 @@ namespace StandAloneRunnerSupport
|
||||
}
|
||||
|
||||
public static string StripWebResourceAxdQuery (string origHtml)
|
||||
{
|
||||
return StripWebResourceAxdQuery (StripWebResourceAxdQuery (origHtml, "\""), """);
|
||||
}
|
||||
|
||||
static string StripWebResourceAxdQuery (string origHtml, string delimiter)
|
||||
{
|
||||
if (String.IsNullOrEmpty (origHtml))
|
||||
return origHtml;
|
||||
|
||||
// Naive approach, enough for now
|
||||
int idx = origHtml.IndexOf ("\"/WebResource.axd");
|
||||
int idx = origHtml.IndexOf (delimiter + "/WebResource.axd");
|
||||
if (idx == -1)
|
||||
return origHtml;
|
||||
|
||||
var sb = new StringBuilder ();
|
||||
sb.Append (origHtml.Substring (0, idx));
|
||||
sb.Append ('"');
|
||||
sb.Append (delimiter);
|
||||
idx++;
|
||||
int idx2 = origHtml.IndexOf ("\"", idx);
|
||||
int idx2 = origHtml.IndexOf (delimiter, idx);
|
||||
string webRes;
|
||||
sb.Append ("/WebResource.axd");
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2010 Novell, Inc http://novell.com/
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#if NET_4_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Util;
|
||||
|
||||
using StandAloneRunnerSupport;
|
||||
using StandAloneTests;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace StandAloneTests.ControlRenderingCompatibilityVersion
|
||||
{
|
||||
[TestCase ("ControlRenderingCompatibilityVersion", "PagesSection.ControlRenderingCompatibilityVersion")]
|
||||
public sealed class Test_01 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "ControlRenderingCompatibilityVersion"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("LessThan3.5/Default.aspx", Default_Aspx_LessThan35));
|
||||
runItems.Add (new TestRunItem ("MoreThan4.0/Default.aspx", Default_Aspx_MoreThan40));
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "4.0 2.0";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_LessThan35 (string result, TestRunItem runItem)
|
||||
{
|
||||
Assert.IsTrue (result.IndexOf ("[System.Configuration.ConfigurationErrorsException]") != -1, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_MoreThan40 (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "5.0";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,103 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2010 Novell, Inc http://novell.com/
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#if NET_4_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Util;
|
||||
|
||||
using StandAloneRunnerSupport;
|
||||
using StandAloneTests;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace StandAloneTests.DisabledAttributeRendering
|
||||
{
|
||||
[TestCase ("DisabledAttributeRendering 01", "4.0 does not render the 'disabled' attribute in default mode. Using default CSS class name.")]
|
||||
public sealed class Test_01 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "DisabledAttributeRendering", "DefaultClassName"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("OldRendering/Default.aspx", OldRendering_Default_Aspx));
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div class=\"aspNetDisabled MyClass\">\r\n\tI am disabled\r\n</div><a class=\"aspNetDisabled\">Disabled link</a>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void OldRendering_Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div disabled=\"disabled\" class=\"MyClass\">\r\n\tI am disabled\r\n</div><a disabled=\"disabled\">Disabled link</a>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
|
||||
[TestCase ("DisabledAttributeRendering 02", "4.0 does not render the 'disabled' attribute in default mode. Using custom CSS class name.")]
|
||||
public sealed class Test_02 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "DisabledAttributeRendering", "CustomClassName"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("OldRendering/Default.aspx", OldRendering_Default_Aspx));
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div class=\"MyDisabledControlClass MyClass\">\r\n\tI am disabled\r\n</div><a class=\"MyDisabledControlClass\">Disabled link</a>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void OldRendering_Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div disabled=\"disabled\" class=\"MyClass\">\r\n\tI am disabled\r\n</div><a disabled=\"disabled\">Disabled link</a>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2010 Novell, Inc http://novell.com/
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#if NET_4_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Util;
|
||||
|
||||
using StandAloneRunnerSupport;
|
||||
using StandAloneTests;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace StandAloneTests.GridViewShowHeaderWhenEmpty
|
||||
{
|
||||
[TestCase ("GridViewShowHeaderWhenEmpty 01", "GridView.ShowHeaderWhenEmpty tests")]
|
||||
public sealed class Test_01 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "GridViewShowHeaderWhenEmpty"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("NoHeaderAtAll.aspx", NoHeaderAtAll_Aspx));
|
||||
runItems.Add (new TestRunItem ("NoHeaderWhenEmpty.aspx", NoHeaderWhenEmpty_Aspx));
|
||||
runItems.Add (new TestRunItem ("WithHeaderWhenEmpty.aspx", WithHeaderWhenEmpty_Aspx));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\r\n</div><pre id=\"log\"></pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void NoHeaderAtAll_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\r\n</div><pre id=\"log\"></pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void NoHeaderWhenEmpty_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\r\n</div><pre id=\"log\"></pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void WithHeaderWhenEmpty_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ProductID</th><th scope=\"col\">ProductName</th><th scope=\"col\">ProductComment</th>\r\n\t\t</tr>\r\n\t</table>\r\n</div><pre id=\"log\">OnRowCreated called</pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,121 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2010 Novell, Inc http://novell.com/
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
#if NET_4_0
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web.Util;
|
||||
|
||||
using StandAloneRunnerSupport;
|
||||
using StandAloneTests;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace StandAloneTests.GridViewSortingStyles
|
||||
{
|
||||
[TestCase ("GridViewSortingStyles 01", "GridView supports separate styles for headers/cells when sorting.")]
|
||||
public sealed class Test_01 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "GridViewSortingStyles"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx_Ascending_ProductName) {
|
||||
PostValues = new string[] {
|
||||
"__EVENTTARGET", "GridView1",
|
||||
"__EVENTARGUMENT", "Sort$ProductName"
|
||||
},
|
||||
UrlDescription = "Ascending sorting on ProductName"
|
||||
}
|
||||
);
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx_Descending_ProductName) {
|
||||
PostValues = new string[] {
|
||||
"__EVENTTARGET", "GridView1",
|
||||
"__EVENTARGUMENT", "Sort$ProductName"
|
||||
},
|
||||
UrlDescription = "Descending sorting on ProductName"
|
||||
}
|
||||
);
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx_Ascending_ProductID) {
|
||||
PostValues = new string[] {
|
||||
"__EVENTTARGET", "GridView1",
|
||||
"__EVENTARGUMENT", "Sort$ProductID"
|
||||
},
|
||||
UrlDescription = "Ascending sorting on ProductID"
|
||||
}
|
||||
);
|
||||
runItems.Add (new TestRunItem ("Default.aspx", Default_Aspx_Descending_ProductID) {
|
||||
PostValues = new string[] {
|
||||
"__EVENTTARGET", "GridView1",
|
||||
"__EVENTARGUMENT", "Sort$ProductID"
|
||||
},
|
||||
UrlDescription = "Descending sorting on ProductID"
|
||||
}
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductName')\">Name</a></th><th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductID')\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Pear</td><td>1</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Apple</td><td>2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Orange</td><td>3</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_Ascending_ProductName (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\" style=\"background-color:Yellow;\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductName')\">Name</a></th><th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductID')\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Apple</td><td>2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Orange</td><td>3</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:LightYellow;\">Pear</td><td>1</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_Descending_ProductName (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\" style=\"background-color:LightBlue;\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductName')\">Name</a></th><th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductID')\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:AliceBlue;\">Pear</td><td>1</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:AliceBlue;\">Orange</td><td>3</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td style=\"background-color:AliceBlue;\">Apple</td><td>2</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_Ascending_ProductID (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductName')\">Name</a></th><th scope=\"col\" style=\"background-color:Yellow;\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductID')\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Pear</td><td style=\"background-color:LightYellow;\">1</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Apple</td><td style=\"background-color:LightYellow;\">2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Orange</td><td style=\"background-color:LightYellow;\">3</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Aspx_Descending_ProductID (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductName')\">Name</a></th><th scope=\"col\" style=\"background-color:LightBlue;\"><a href=\"javascript:__doPostBack('GridView1','Sort$ProductID')\">ID</a></th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Orange</td><td style=\"background-color:AliceBlue;\">3</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Apple</td><td style=\"background-color:AliceBlue;\">2</td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>Pear</td><td style=\"background-color:AliceBlue;\">1</td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -60,19 +60,19 @@ namespace StandAloneTests.SiteMapDuplicateEntries_Bug570194
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = @"<span><a href=""#ctl03_SkipLink""><img height=""0"" width=""0"" src=""/WebResource.axd"" alt=""Skip Navigation Links"" style=""border-width:0px;"" /></a><span><a href=""/Default.aspx"">Main</a></span><a id=""ctl03_SkipLink""></a></span>";
|
||||
string originalHtml = "<span><a href=\"#ctl03_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><a id=\"ctl03_SkipLink\"></a></span>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Foo_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = @"<span><a href=""#ctl03_SkipLink""><img height=""0"" width=""0"" src=""/WebResource.axd"" alt=""Skip Navigation Links"" style=""border-width:0px;"" /></a><span><a href=""/Default.aspx"">Main</a></span><span> > </span><span><a href=""/Default.aspx?mode=foo"">Foo</a></span><a id=""ctl03_SkipLink""></a></span>";
|
||||
string originalHtml = "<span><a href=\"#ctl03_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=foo\">Foo</a></span><a id=\"ctl03_SkipLink\"></a></span>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Bar_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = @"<span><a href=""#ctl03_SkipLink""><img height=""0"" width=""0"" src=""/WebResource.axd"" alt=""Skip Navigation Links"" style=""border-width:0px;"" /></a><span><a href=""/Default.aspx"">Main</a></span><span> > </span><span><a href=""/Default.aspx?mode=bar"">Bar</a></span><a id=""ctl03_SkipLink""></a></span>";
|
||||
string originalHtml = "<span><a href=\"#ctl03_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=bar\">Bar</a></span><a id=\"ctl03_SkipLink\"></a></span>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// Authors:
|
||||
// Marek Habersack ([email protected])
|
||||
//
|
||||
// (C) 2010 Novell, Inc http://novell.com/
|
||||
//
|
||||
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.Hosting;
|
||||
|
||||
using StandAloneRunnerSupport;
|
||||
using StandAloneTests;
|
||||
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace StandAloneTests.SiteMapPathRendering
|
||||
{
|
||||
[TestCase ("SiteMapPathRendering", "SiteMapPath does not use child controls when rendering.")]
|
||||
public sealed class SiteMapPathRendering_01 : ITestCase
|
||||
{
|
||||
public string PhysicalPath {
|
||||
get { return Path.Combine (Consts.BasePhysicalDir, "SiteMapPathRendering"); }
|
||||
}
|
||||
|
||||
public string VirtualPath {
|
||||
get { return "/"; }
|
||||
}
|
||||
|
||||
public bool SetUp (List <TestRunItem> runItems)
|
||||
{
|
||||
runItems.Add (new TestRunItem ("/Default.aspx", Default_Aspx));
|
||||
runItems.Add (new TestRunItem ("/Default.aspx?mode=foo", Default_Foo_Aspx));
|
||||
runItems.Add (new TestRunItem ("/Default.aspx?mode=bar", Default_Bar_Aspx));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<span id=\"sitemap\"><a href=\"#sitemap_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><a id=\"sitemap_SkipLink\"></a></span><pre id=\"log\">\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl00]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl00$ctl00]\r\n</pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Foo_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<span id=\"sitemap\"><a href=\"#sitemap_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=foo\">Foo</a></span><a id=\"sitemap_SkipLink\"></a></span><pre id=\"log\">\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl00]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl00$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl01]\r\n\tSystem.Web.UI.WebControls.Literal [sitemap$ctl01$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl02]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl02$ctl00]\r\n</pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
|
||||
void Default_Bar_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<span id=\"sitemap\"><a href=\"#sitemap_SkipLink\"><img alt=\"Skip Navigation Links\" height=\"0\" width=\"0\" src=\"/WebResource.axd\" style=\"border-width:0px;\" /></a><span><a href=\"/Default.aspx\">Main</a></span><span> > </span><span><a href=\"/Default.aspx?mode=bar\">Bar</a></span><a id=\"sitemap_SkipLink\"></a></span><pre id=\"log\">\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl00]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl00$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl01]\r\n\tSystem.Web.UI.WebControls.Literal [sitemap$ctl01$ctl00]\r\n\tSystem.Web.UI.WebControls.SiteMapNodeItem [sitemap$ctl02]\r\n\tSystem.Web.UI.WebControls.HyperLink [sitemap$ctl02$ctl00]\r\n</pre>";
|
||||
Helpers.ExtractAndCompareCodeFromHtml (Helpers.StripWebResourceAxdQuery (result), originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,11 @@ namespace StandAloneTests.WebControlsMustUseIsEnabled_Bug571715
|
||||
|
||||
void Default_Aspx (string result, TestRunItem runItem)
|
||||
{
|
||||
string originalHtml = "<div>\r\n <table id=\"GridView1\" cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">\r\n <tr>\r\n <th scope=\"col\">ID</th><th scope=\"col\">FULLNAME</th><th scope=\"col\"> </th>\r\n </tr><tr>\r\n <td>1</td><td>Sheryl Hunter</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl02$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl02_DeleteBtn\" /></td>\r\n </tr><tr>\r\n <td>2</td><td>Dean Straight</td><td disabled=\"disabled\" align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl03$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl03_DeleteBtn\" disabled=\"disabled\" /></td>\r\n </tr><tr>\r\n <td>3</td><td>Marjorie Green</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl04$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl04_DeleteBtn\" /></td>\r\n </tr>\r\n </table>\r\n </div>";
|
||||
#if NET_4_0
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ID</th><th scope=\"col\">FULLNAME</th><th scope=\"col\"> </th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>1</td><td>Sheryl Hunter</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl02$DeleteBtn\" value=\"Delete\" id=\"GridView1_DeleteBtn_0\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>2</td><td>Dean Straight</td><td class=\"aspNetDisabled\" align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl03$DeleteBtn\" value=\"Delete\" disabled=\"disabled\" id=\"GridView1_DeleteBtn_1\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>3</td><td>Marjorie Green</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl04$DeleteBtn\" value=\"Delete\" id=\"GridView1_DeleteBtn_2\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#else
|
||||
string originalHtml = "<div>\r\n\t<table cellspacing=\"0\" rules=\"all\" border=\"1\" id=\"GridView1\" style=\"border-collapse:collapse;\">\r\n\t\t<tr>\r\n\t\t\t<th scope=\"col\">ID</th><th scope=\"col\">FULLNAME</th><th scope=\"col\"> </th>\r\n\t\t</tr><tr>\r\n\t\t\t<td>1</td><td>Sheryl Hunter</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl02$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl02_DeleteBtn\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>2</td><td>Dean Straight</td><td disabled=\"disabled\" align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl03$DeleteBtn\" value=\"Delete\" disabled=\"disabled\" id=\"GridView1_ctl03_DeleteBtn\" /></td>\r\n\t\t</tr><tr>\r\n\t\t\t<td>3</td><td>Marjorie Green</td><td align=\"left\" style=\"width:60px;\"><input type=\"submit\" name=\"GridView1$ctl04$DeleteBtn\" value=\"Delete\" id=\"GridView1_ctl04_DeleteBtn\" /></td>\r\n\t\t</tr>\r\n\t</table>\r\n</div>";
|
||||
#endif
|
||||
Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
ControlRenderingCompatibilityVersion: <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><%= GetVersion () %> <%= SetAndGetVersion (2, 0) %><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected string GetVersion ()
|
||||
{
|
||||
var ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
|
||||
|
||||
|
||||
return ps.ControlRenderingCompatibilityVersion.ToString ();
|
||||
}
|
||||
|
||||
protected string SetAndGetVersion (int major, int minor)
|
||||
{
|
||||
RenderingCompatibility = new Version (major, minor);
|
||||
return RenderingCompatibility.ToString ();
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
ControlRenderingCompatibilityVersion: <%= GetVersion () %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected string GetVersion ()
|
||||
{
|
||||
var ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
|
||||
|
||||
return ps.ControlRenderingCompatibilityVersion.ToString ();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
<pages controlRenderingCompatibilityVersion="2.0"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
ControlRenderingCompatibilityVersion: <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><%= GetVersion () %><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Configuration;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected string GetVersion ()
|
||||
{
|
||||
var ps = WebConfigurationManager.GetSection ("system.web/pages") as PagesSection;
|
||||
|
||||
return ps.ControlRenderingCompatibilityVersion.ToString ();
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
<pages controlRenderingCompatibilityVersion="5.0"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
</system.web>
|
||||
</configuration>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:Panel runat="server" Enabled="false" CssClass="MyClass">I am disabled</asp:Panel><asp:LinkButton runat="server" Enabled="false" Text="Disabled link" PostBackUrl="~/Default.aspx"/><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<%@ Application Language="C#" %>
|
||||
<script RunAt="server">
|
||||
void Application_Start (object sender, EventArgs e)
|
||||
{
|
||||
WebControl.DisabledCssClass = "MyDisabledControlClass";
|
||||
}
|
||||
</script>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:Panel runat="server" Enabled="false" CssClass="MyClass">I am disabled</asp:Panel><asp:LinkButton runat="server" Enabled="false" Text="Disabled link" PostBackUrl="~/Default.aspx"/><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
<pages controlRenderingCompatibilityVersion="3.5"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
</system.web>
|
||||
</configuration>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:Panel runat="server" Enabled="false" CssClass="MyClass">I am disabled</asp:Panel><asp:LinkButton runat="server" Enabled="false" Text="Disabled link" PostBackUrl="~/Default.aspx"/><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:Panel runat="server" Enabled="false" CssClass="MyClass">I am disabled</asp:Panel><asp:LinkButton runat="server" Enabled="false" Text="Disabled link" PostBackUrl="~/Default.aspx"/><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
<pages controlRenderingCompatibilityVersion="3.5"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
public class TestData
|
||||
{
|
||||
public string ProductID { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public string ProductComment { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" OnRowCreated="GridView1_RowCreated"/><pre runat="server" id="log" /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
var data = new List<TestData> ();
|
||||
|
||||
GridView1.DataSource = data;
|
||||
GridView1.DataBind ();
|
||||
}
|
||||
|
||||
protected void GridView1_RowCreated (object sender, GridViewRowEventArgs args)
|
||||
{
|
||||
log.InnerText = "OnRowCreated called";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NoHeaderAtAll.aspx.cs" Inherits="NoHeaderAtAll" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" ShowHeader="false" ShowHeaderWhenEmpty="true" OnRowCreated="GridView1_RowCreated"/><pre runat="server" id="log" /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class NoHeaderAtAll : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
var data = new List<TestData> ();
|
||||
|
||||
GridView1.DataSource = data;
|
||||
GridView1.DataBind ();
|
||||
}
|
||||
|
||||
protected void GridView1_RowCreated (object sender, GridViewRowEventArgs args)
|
||||
{
|
||||
log.InnerText = "OnRowCreated called";
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NoHeaderWhenEmpty.aspx.cs" Inherits="NoHeaderWhenEmpty" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" ShowHeaderWhenEmpty="false" OnRowCreated="GridView1_RowCreated"/><pre runat="server" id="log" /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class NoHeaderWhenEmpty : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
var data = new List<TestData> ();
|
||||
|
||||
GridView1.DataSource = data;
|
||||
GridView1.DataBind ();
|
||||
}
|
||||
|
||||
protected void GridView1_RowCreated (object sender, GridViewRowEventArgs args)
|
||||
{
|
||||
log.InnerText = "OnRowCreated called";
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WithHeaderWhenEmpty.aspx.cs" Inherits="WithHeaderWhenEmpty" %>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div>
|
||||
<%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView runat="server" ID="GridView1" AutoGenerateColumns="true" ShowHeaderWhenEmpty="true" OnRowCreated="GridView1_RowCreated"/><pre runat="server" id="log" /><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class WithHeaderWhenEmpty : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
var data = new List<TestData> ();
|
||||
|
||||
GridView1.DataSource = data;
|
||||
GridView1.DataBind ();
|
||||
}
|
||||
|
||||
protected void GridView1_RowCreated (object sender, GridViewRowEventArgs args)
|
||||
{
|
||||
log.InnerText = "OnRowCreated called";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
public class TestData
|
||||
{
|
||||
public string ProductID { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
public class TestDataComparer : IComparer<TestData>
|
||||
{
|
||||
bool byID;
|
||||
bool ascending;
|
||||
|
||||
public TestDataComparer (bool byID, bool ascending)
|
||||
{
|
||||
this.byID = byID;
|
||||
this.ascending = ascending;
|
||||
}
|
||||
|
||||
public int Compare (TestData x, TestData y)
|
||||
{
|
||||
if (x == null) {
|
||||
if (y == null)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (y == null)
|
||||
return 1;
|
||||
|
||||
if (byID) {
|
||||
int xid = Int32.Parse (x.ProductID);
|
||||
int yid = Int32.Parse (y.ProductID);
|
||||
|
||||
return ascending ? xid - yid : yid - xid;
|
||||
} else {
|
||||
int ret = String.Compare (x.ProductName, y.ProductName);
|
||||
return ascending ? ret : -ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
|
||||
public class TestDatabase
|
||||
{
|
||||
List <TestData> data = new List<TestData> {
|
||||
new TestData { ProductID="1", ProductName="Pear"},
|
||||
new TestData { ProductID="2", ProductName="Apple"},
|
||||
new TestData { ProductID="3", ProductName="Orange"}
|
||||
};
|
||||
|
||||
public List<TestData> GetData (string sortExpression)
|
||||
{
|
||||
if (String.IsNullOrEmpty (sortExpression))
|
||||
return data;
|
||||
|
||||
bool ascending;
|
||||
string field;
|
||||
int subtract;
|
||||
|
||||
if (sortExpression.EndsWith (" desc", StringComparison.OrdinalIgnoreCase)) {
|
||||
ascending = false;
|
||||
subtract = 5;
|
||||
} else {
|
||||
ascending = true;
|
||||
subtract = 0;
|
||||
}
|
||||
|
||||
if (subtract == 0)
|
||||
field = sortExpression;
|
||||
else
|
||||
field = sortExpression.Substring (0, sortExpression.Length - subtract);
|
||||
|
||||
TestDataComparer comparer;
|
||||
if (String.Compare (field, "ProductName", StringComparison.OrdinalIgnoreCase) == 0)
|
||||
comparer = new TestDataComparer (false, ascending);
|
||||
else
|
||||
comparer = new TestDataComparer (true, ascending);
|
||||
|
||||
data.Sort (comparer);
|
||||
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<div><%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView id="GridView1" runat="server" AutoGenerateColumns="false" AllowSorting="true" DataSourceID="dataSource1"
|
||||
SortedAscendingCellStyle-BackColor="LightYellow" SortedAscendingHeaderStyle-BackColor="Yellow"
|
||||
SortedDescendingCellStyle-BackColor="AliceBlue" SortedDescendingHeaderStyle-BackColor="LightBlue">
|
||||
<Columns>
|
||||
<asp:BoundField SortExpression="ProductName" DataField="ProductName" HeaderText="Name" />
|
||||
<asp:BoundField SortExpression="ProductID" DataField="ProductID" HeaderText="ID" />
|
||||
</Columns>
|
||||
</asp:GridView><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
|
||||
<asp:ObjectDataSource ID="dataSource1" runat="server" TypeName="TestDatabase" SelectMethod="GetData"
|
||||
DataObjectTypeName="TestData" SortParameterName="sortExpression" />
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
public partial class _Default : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load (object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
<configuration>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0"/>
|
||||
</system.web>
|
||||
</configuration>
|
||||
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user