if (SetFocusOnError)
RegisterExpandoAttribute (ClientID, "focusOnError", "t");
#endif
- if (!Enabled)
+ if (!IsEnabled)
#if NET_2_0
RegisterExpandoAttribute (ClientID, "enabled", "False");
#else
#endif
#if NET_2_0
- if (Enabled && !IsValid) {
+ if (IsEnabled && !IsValid) {
RegisterExpandoAttribute (ClientID, "isvalid", "False");
#else
if (!IsValid) {
override void Render (HtmlTextWriter writer)
{
#if NET_2_0
- if (!Enabled && !EnableClientScript)
+ if (!IsEnabled && !EnableClientScript)
return;
#endif
if (render_uplevel) {
#endif
void Validate ()
{
- if (Enabled && Visible)
+ if (IsEnabled && Visible)
IsValid = ControlPropertiesValid () && EvaluateIsValid ();
else
IsValid = true;
break;
case BulletedListDisplayMode.HyperLink:
- if (Enabled && item.Enabled) {
+ if (IsEnabled && item.Enabled) {
writer.AddAttribute (HtmlTextWriterAttribute.Href, item.Value);
- if (Target != "")
+ if (Target.Length > 0)
writer.AddAttribute(HtmlTextWriterAttribute.Target, this.Target);
}
break;
case BulletedListDisplayMode.LinkButton:
- if (Enabled && item.Enabled)
+ if (IsEnabled && item.Enabled)
writer.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackEventReference (GetPostBackOptions (index.ToString (Helpers.InvariantCulture)), true));
else
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
[DefaultValueAttribute ("")]
[TypeConverter (typeof (TargetConverter))]
public virtual string Target {
- get { return ViewState.GetString ("Target", ""); }
+ get { return ViewState.GetString ("Target", String.Empty); }
set { ViewState ["Target"] = value; }
}
writer.RenderBeginTag (HtmlTextWriterTag.Table);
#if NET_2_0
- if (Caption != "")
+ if (!String.IsNullOrEmpty (Caption))
WriteCaption (writer);
#endif
-
+ bool enabled = IsEnabled;
+
if (ShowTitle)
- WriteTitle (writer);
-
+ WriteTitle (writer, enabled);
+
if (ShowDayHeader)
- WriteDayHeader (writer);
+ WriteDayHeader (writer, enabled);
- WriteDays (writer);
+ WriteDays (writer, enabled);
writer.RenderEndTag ();
}
//
// Private methods
//
- void WriteDayHeader (HtmlTextWriter writer)
+ void WriteDayHeader (HtmlTextWriter writer, bool enabled)
{
int i, first;
string dayName;
int days = DateTime.DaysInMonth (DisplayDate.Year, DisplayDate.Month);
selector.RenderBeginTag (writer);
- writer.Write (BuildLink ("R" + GetDaysFromZenith (date) + days, SelectMonthText, DayHeaderStyle.ForeColor, Enabled));
+ writer.Write (BuildLink ("R" + GetDaysFromZenith (date) + days, SelectMonthText, DayHeaderStyle.ForeColor, enabled));
selector.RenderEndTag (writer);
}
}
writer.RenderEndTag ();
}
- void WriteDay (DateTime date, HtmlTextWriter writer)
+ void WriteDay (DateTime date, HtmlTextWriter writer, bool enabled)
{
TableItemStyle style = new TableItemStyle ();
TableCell cell = new TableCell ();
style.CopyFrom (otherMonthDayStyle);
}
- if (day.IsSelected && Enabled) {
+ if (enabled && day.IsSelected) {
style.BackColor = Color.Silver;
style.ForeColor = Color.White;
if (selectedDayStyle != null && !selectedDayStyle.IsEmpty) {
cell.ApplyStyle (style);
lit.Text = BuildLink (GetDaysFromZenith (date).ToString (), day.DayNumberText,
- cell.ForeColor, day.IsSelectable && Enabled);
+ cell.ForeColor, enabled && day.IsSelectable);
cell.RenderControl (writer);
}
- void WriteDays (HtmlTextWriter writer)
+ void WriteDays (HtmlTextWriter writer, bool enabled)
{
DateTime date = new DateTime (DisplayDate.Year, DisplayDate.Month, 1); // first date
DateTime lastDate;
}
selectorCell.RenderBeginTag (writer);
- writer.Write (BuildLink ("R" + GetDaysFromZenith (date) + "07", SelectWeekText, selectorCell.ForeColor, Enabled));
+ writer.Write (BuildLink ("R" + GetDaysFromZenith (date) + "07", SelectWeekText, selectorCell.ForeColor, enabled));
selectorCell.RenderEndTag (writer);
}
for (int i = 0; i < daysInAWeek; i++) {
- WriteDay (date, writer);
+ WriteDay (date, writer, enabled);
date = GetGlobalCalendar().AddDays (date, 1);
}
}
#endif
- void WriteTitle (HtmlTextWriter writer)
+ void WriteTitle (HtmlTextWriter writer, bool enabled)
{
TableCell cellNextPrev = null;
TableCell titleCell = new TableCell ();
DateTime date = GetGlobalCalendar().AddMonths (DisplayDate, - 1);
date = GetGlobalCalendar ().AddDays (date, -date.Day + 1);
cellNextPrev.RenderBeginTag (writer);
- writer.Write (BuildLink ("V" + GetDaysFromZenith (date), GetNextPrevFormatText (date, false), cellNextPrev.ForeColor, Enabled));
+ writer.Write (BuildLink ("V" + GetDaysFromZenith (date), GetNextPrevFormatText (date, false), cellNextPrev.ForeColor, enabled));
cellNextPrev.RenderEndTag (writer);
}
cellNextPrev.HorizontalAlign = HorizontalAlign.Right;
cellNextPrev.RenderBeginTag (writer);
- writer.Write (BuildLink ("V" + GetDaysFromZenith (date), GetNextPrevFormatText (date, true), cellNextPrev.ForeColor, Enabled));
+ writer.Write (BuildLink ("V" + GetDaysFromZenith (date), GetNextPrevFormatText (date, true), cellNextPrev.ForeColor, enabled));
cellNextPrev.RenderEndTag (writer);
}
+2010-06-21 Marek Habersack <mhabersack@novell.com>
+
+ * BaseValidator.cs, BulletedList.cs, Calendar.cs, CheckBox.cs,
+ CheckBoxList.cs, DataGrid.cs, DropDownList.cs, GridView.cs,
+ HyperLink.cs, ImageButton.cs, LinkButton.cs, ListBox.cs,
+ ListControl.cs, Menu.cs, RadioButton.cs, RadioButtonList.cs,
+ RepeatInfo.cs, Repeater.cs, TextBox.cs, TreeView.cs,
+ ValidationSummary.cs, WebControl.cs: use WebControl.IsEnabled
+ instead of Enabled wherever necessary.
+
2010-06-16 Marek Habersack <mhabersack@novell.com>
* FormView.cs: row values must be retrieved with inclusion of
{
base.OnPreRender (e);
Page page = Page;
- bool enabled = Enabled;
- if (page != null && enabled) {
+ if (page != null && IsEnabled) {
page.RegisterRequiresPostBack (this);
- }
#if NET_2_0
- if (Page != null && enabled)
page.RegisterEnabledControl (this);
#endif
+ }
}
static bool IsInputOrCommonAttr (string attname)
ControlStyle.AddAttributesToRender (w, this);
}
- if (!Enabled) {
+ bool enabled = IsEnabled;
+ if (!enabled) {
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
need_span = true;
}
TextAlign align = TextAlign;
if (align == TextAlign.Right) {
- RenderInput (w);
+ RenderInput (w, enabled);
RenderLabel (w);
} else {
RenderLabel (w);
- RenderInput (w);
+ RenderInput (w, enabled);
}
if (need_span)
w.RenderEndTag ();
}
- void RenderInput (HtmlTextWriter w) {
-
+ void RenderInput (HtmlTextWriter w, bool enabled)
+ {
if (ClientID != null && ClientID.Length > 0)
w.AddAttribute (HtmlTextWriterAttribute.Id, ClientID);
w.AddAttribute (HtmlTextWriterAttribute.Type, render_type);
string nameAttr = NameAttribute;
if (nameAttr != null && nameAttr.Length > 0)
w.AddAttribute (HtmlTextWriterAttribute.Name, nameAttr);
- InternalAddAttributesToRender (w);
+ InternalAddAttributesToRender (w, enabled);
#if NET_2_0
AddAttributesToRender (w);
if (inputAttributes != null)
#endif
bool LoadPostData (string postDataKey, NameValueCollection postCollection)
{
- if (!Enabled)
+ if (!IsEnabled)
return false;
string postedValue = postCollection[postDataKey];
}
#endif
- internal virtual void InternalAddAttributesToRender (HtmlTextWriter w)
+ internal virtual void InternalAddAttributesToRender (HtmlTextWriter w, bool enabled)
{
- if (!Enabled)
+ if (!enabled)
w.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
}
}
check_box.AutoPostBack = AutoPostBack;
check_box.Checked = item.Selected;
check_box.TextAlign = TextAlign;
- if (!Enabled)
+ if (!IsEnabled)
check_box.Enabled = false;
else
check_box.Enabled = item.Enabled;
rt.Caption = Caption;
rt.CaptionAlign = CaptionAlign;
- rt.Enabled = Enabled;
+ rt.Enabled = IsEnabled;
bool top_pager = true;
foreach (DataGridItem item in rt.Rows) {
if (!String.IsNullOrEmpty (UniqueID))
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
- if (!Enabled && SelectedIndex == -1)
+ if (!IsEnabled && SelectedIndex == -1)
SelectedIndex = 1;
#else
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
}
}
return 0;
- }
- else {
+ } else {
GridViewRow footerRow = CreateRow (-1, -1, DataControlRowType.Footer, DataControlRowState.Normal);
InitializeRow (footerRow, fields);
OnRowCreated (new GridViewRowEventArgs (footerRow));
#if NET_2_0
AddDisplayStyleAttribute (w);
#endif
- if (!Enabled)
+ if (!IsEnabled)
return;
// add attributes - only if they're not empty
string t = Target;
#endif
override void OnPreRender (EventArgs e)
{
- if (Page != null && Enabled)
- Page.RegisterRequiresPostBack (this);
+ Page page = Page;
+ if (page != null && IsEnabled)
+ page.RegisterRequiresPostBack (this);
}
[WebSysDescription ("")]
protected override void AddAttributesToRender (HtmlTextWriter w)
{
- if (Page != null)
- Page.VerifyRenderingInServerForm (this);
+ Page page = Page;
+ if (page != null)
+ page.VerifyRenderingInServerForm (this);
+ bool enabled = IsEnabled;
#if NET_2_0
string onclick = OnClientClick;
onclick = ClientScriptManager.EnsureEndsWithSemicolon (onclick);
if (onclick.Length > 0)
w.AddAttribute (HtmlTextWriterAttribute.Onclick, onclick);
-
- if (Enabled && Page != null) {
+
+ if (enabled && page != null) {
PostBackOptions options = GetPostBackOptions ();
- string href = Page.ClientScript.GetPostBackEventReference (options, true);
+ string href = page.ClientScript.GetPostBackEventReference (options, true);
w.AddAttribute (HtmlTextWriterAttribute.Href, href);
}
base.AddAttributesToRender (w);
AddDisplayStyleAttribute (w);
#else
base.AddAttributesToRender (w);
- if (Page == null || !Enabled)
+ if (page == null || !enabled)
return;
- if (CausesValidation && Page.AreValidatorsUplevel ()) {
- ClientScriptManager csm = new ClientScriptManager (Page);
+ if (CausesValidation && page.AreValidatorsUplevel ()) {
+ ClientScriptManager csm = new ClientScriptManager (page);
w.AddAttribute (HtmlTextWriterAttribute.Href,
String.Concat ("javascript:{if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); ",
csm.GetPostBackEventReference (this, String.Empty), ";}"));
} else {
- w.AddAttribute (HtmlTextWriterAttribute.Href, Page.ClientScript.GetPostBackClientHyperlink (this, ""));
+ w.AddAttribute (HtmlTextWriterAttribute.Href, page.ClientScript.GetPostBackClientHyperlink (this, String.Empty));
}
#endif
}
override void OnPreRender (EventArgs e)
{
base.OnPreRender (e);
- if (Page != null && Enabled)
- Page.RegisterRequiresPostBack (this);
+ Page page = Page;
+ if (page != null && IsEnabled)
+ page.RegisterRequiresPostBack (this);
}
#if NET_2_0
{
base.OnPreRender (e);
#if NET_2_0
- if (Page != null && Enabled)
- Page.RegisterEnabledControl (this);
+ Page page = Page;
+ if (page != null && IsEnabled)
+ page.RegisterEnabledControl (this);
#endif
}
protected internal virtual void RaisePostBackEvent (string eventArgument)
{
ValidateEvent (UniqueID, eventArgument);
- if (!Enabled)
+ if (!IsEnabled)
return;
EnsureChildControls();
}
}
- internal override void InternalAddAttributesToRender (HtmlTextWriter w)
+ internal override void InternalAddAttributesToRender (HtmlTextWriter w, bool enabled)
{
#if NET_2_0
Page page = Page;
if (page != null)
page.ClientScript.RegisterForEventValidation (NameAttribute, ValueAttribute);
#endif
- base.InternalAddAttributesToRender (w);
+ base.InternalAddAttributesToRender (w, enabled);
w.AddAttribute (HtmlTextWriterAttribute.Value, ValueAttribute);
}
radio.Checked = item.Selected;
radio.ValueAttribute = item.Value;
radio.AutoPostBack = AutoPostBack;
- radio.Enabled = Enabled;
+ radio.Enabled = IsEnabled;
radio.TabIndex = tabIndex;
#if NET_2_0
radio.ValidationGroup = ValidationGroup;
c.ID = wc.ClientID;
c.CopyBaseAttributes (wc);
c.ApplyStyle (s);
- c.Enabled = wc.Enabled;
+ c.Enabled = wc.IsEnabled;
c.RenderBeginTag (w);
}
protected internal override void OnInit (EventArgs e)
{
base.OnInit (e);
- if (Page != null) {
- Page.PreLoad += new EventHandler (OnPagePreLoad);
+ Page page = Page;
+ if (page != null) {
+ page.PreLoad += new EventHandler (OnPagePreLoad);
- if (!IsViewStateEnabled && Page.IsPostBack)
+ if (!IsViewStateEnabled && page.IsPostBack)
RequiresDataBinding = true;
}
}
void Initialize ()
{
- if (Page != null) {
- if (!Page.IsPostBack || (IsViewStateEnabled && (ViewState ["Items"] == null)))
+ Page page = Page;
+ if (page != null) {
+ if (!page.IsPostBack || (IsViewStateEnabled && (ViewState ["Items"] == null)))
RequiresDataBinding = true;
}
}
Page page = Page;
- if (page != null && Enabled)
+ if (page != null && IsEnabled)
page.RegisterEnabledControl (this);
#endif
}
{
base.OnPreRender (e);
- if (Page != null) {
- if (Enabled)
- Page.RegisterRequiresPostBack (this);
+ Page page = Page;
+ if (page != null) {
+ if (IsEnabled)
+ page.RegisterRequiresPostBack (this);
- if (EnableClientScript && !Page.ClientScript.IsClientScriptIncludeRegistered (typeof(TreeView), "TreeView.js")) {
- string url = Page.ClientScript.GetWebResourceUrl (typeof(TreeView), "TreeView.js");
- Page.ClientScript.RegisterClientScriptInclude (typeof(TreeView), "TreeView.js", url);
+ if (EnableClientScript && !page.ClientScript.IsClientScriptIncludeRegistered (typeof(TreeView), "TreeView.js")) {
+ string url = page.ClientScript.GetWebResourceUrl (typeof(TreeView), "TreeView.js");
+ page.ClientScript.RegisterClientScriptInclude (typeof(TreeView), "TreeView.js", url);
}
}
ClientScriptManager.GetScriptLiteral (GetNodeImageUrl ("noexpand", imageStyle)));
}
- if (Page != null) {
+ if (page != null) {
script.AppendFormat (_OnPreRender_Script_PopulateCallback,
ctree,
- Page.theForm,
- Page.WebFormScriptReference);
+ page.theForm,
+ page.WebFormScriptReference);
// Page.ClientScript.GetCallbackEventReference (
// "this.uid", "nodeId",
ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (true, null)),
ClientScriptManager.GetScriptLiteral (GetNodeImageToolTip (false, null)));
- if (!Page.IsPostBack)
+ if (!page.IsPostBack)
SetNodesExpandedToDepthRecursive (Nodes);
- if (EnableClientScript) {
- Page.ClientScript.RegisterHiddenField (ClientID + "_ExpandStates", GetExpandStates ());
+ bool enableClientScript = EnableClientScript;
+ if (enableClientScript) {
+ page.ClientScript.RegisterHiddenField (ClientID + "_ExpandStates", GetExpandStates ());
// Make sure the basic script infrastructure is rendered
- Page.ClientScript.RegisterWebFormClientScript ();
+ page.ClientScript.RegisterWebFormClientScript ();
}
- if (EnableClientScript && PopulateNodesFromClient)
- Page.ClientScript.RegisterHiddenField (ClientID + "_PopulatedStates", "|");
+ if (enableClientScript && PopulateNodesFromClient)
+ page.ClientScript.RegisterHiddenField (ClientID + "_PopulatedStates", "|");
EnsureStylesPrepared ();
if (hoverNodeStyle != null) {
- if (Page.Header == null)
+ if (page.Header == null)
throw new InvalidOperationException ("Using TreeView.HoverNodeStyle requires Page.Header to be non-null (e.g. <head runat=\"server\" />).");
RegisterStyle (HoverNodeStyle, HoverNodeLinkStyle);
script.AppendFormat (_OnPreRender_Script_HoverStyle,
ClientScriptManager.GetScriptLiteral (HoverNodeLinkStyle.RegisteredCssClass));
}
- Page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script.ToString (), true);
+ page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script.ToString (), true);
script = null;
}
}
#endif
override void Render(HtmlTextWriter writer) {
#if NET_2_0
- if (!Enabled)
+ if (!IsEnabled)
return;
#endif
ValidatorCollection validators;
}
#if NET_2_0
- protected internal bool IsEnabled
+ protected
+#endif
+ internal bool IsEnabled
{
get {
+#if NET_2_0
WebControl wc = this;
while (wc != null) {
if (!wc.Enabled)
wc = wc.Parent as WebControl;
}
return true;
+#else
+ return Enabled;
+#endif
}
}
-#endif
-
public void ApplyStyle (Style s)
{
if (AccessKey != string.Empty)
writer.AddAttribute (HtmlTextWriterAttribute.Accesskey, AccessKey);
- if (!enabled)
+ if (!IsEnabled)
writer.AddAttribute (HtmlTextWriterAttribute.Disabled, "disabled", false);
if (ToolTip != string.Empty)
Test/standalone-tests/FormViewUpdateParameters_Bug607722.cs
Test/standalone-tests/RootBuilderChildControlTypes_Bug603541.cs
Test/standalone-tests/MD5PasswordAuth_Bug601727.cs
+Test/standalone-tests/WebControlsMustUseIsEnabled_Bug571715.cs
--- /dev/null
+//
+// Authors:
+// Marek Habersack (mhabersack@novell.com)
+//
+// (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.WebControlsMustUseIsEnabled_Bug571715
+{
+ [TestCase ("WebControlsMustUseIsEnabled_Bug571715", "WebControl descendants must use IsEnabled instead of Enabled (Bug #571715)")]
+ public sealed class Test_01 : ITestCase
+ {
+ public string PhysicalPath {
+ get { return Path.Combine (Consts.BasePhysicalDir, "WebControlsMustUseIsEnabled_Bug571715"); }
+ }
+
+ public string VirtualPath {
+ get { return "/"; }
+ }
+
+ public bool SetUp (List <TestRunItem> runItems)
+ {
+ runItems.Add (new TestRunItem ("default.aspx", Default_Aspx));
+
+ return true;
+ }
+
+ 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>";
+ Helpers.ExtractAndCompareCodeFromHtml (result, originalHtml, "#A1");
+ }
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8" ?>
+<people>
+ <person ID="1" FULLNAME="Sheryl Hunter"/>
+ <person ID="2" FULLNAME="Dean Straight"/>
+ <person ID="3" FULLNAME="Marjorie Green"/>
+</people>
+
--- /dev/null
+<%@ Page Language="C#" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<script runat="server">
+ protected void GridView1_RowDataBound (object sender, GridViewRowEventArgs e)
+ {
+ if (e.Row.RowType == DataControlRowType.DataRow && e.Row.Cells [0].Text == "2")
+ e.Row.Cells [2].Enabled = false;
+ }
+</script>
+<html xmlns="http://www.w3.org/1999/xhtml" >
+<head runat="server">
+ <title>Bug #571715</title>
+</head>
+<body>
+<form id="form1" runat="server">
+ <%= AppDomain.CurrentDomain.GetData ("BEGIN_CODE_MARKER") %><asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="XmlDataSource1" OnRowDataBound="GridView1_RowDataBound">
+ <Columns>
+ <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
+ <asp:BoundField DataField="FULLNAME" HeaderText="FULLNAME" SortExpression="FULLNAME" />
+ <asp:TemplateField>
+ <ItemTemplate><asp:Button CommandName="Delete" CommandArgument="<%# Container.DataItemIndex %>" Text="Delete" ID="DeleteBtn" runat="server" CausesValidation="False" /></ItemTemplate>
+ <ItemStyle HorizontalAlign="Left" Width="60px" />
+ </asp:TemplateField>
+ </Columns>
+ </asp:GridView><%= AppDomain.CurrentDomain.GetData ("END_CODE_MARKER") %>
+ <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="People.xml"></asp:XmlDataSource>
+</form>
+</body>
+</html>
--- /dev/null
+<?xml version="1.0"?>
+<!--
+ Note: As an alternative to hand editing this file you can use the
+ web admin tool to configure settings for your application. Use
+ the Website->Asp.Net Configuration option in Visual Studio.
+ A full list of settings and comments can be found in
+ machine.config.comments usually located in
+ \Windows\Microsoft.Net\Framework\v2.x\Config
+-->
+<configuration>
+ <appSettings/>
+ <connectionStrings/>
+ <system.web>
+ <!--
+ Set compilation debug="true" to insert debugging
+ symbols into the compiled page. Because this
+ affects performance, set this value to true only
+ during development.
+
+ Visual Basic options:
+ Set strict="true" to disallow all data type conversions
+ where data loss can occur.
+ Set explicit="true" to force declaration of all variables.
+ -->
+ <compilation debug="false" strict="false" explicit="true">
+ <assemblies>
+ <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies></compilation>
+ <httpHandlers>
+ <remove path="*.asmx" verb="*"/>
+ <add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
+ <add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
+ <add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
+ </httpHandlers>
+ <pages>
+ <namespaces>
+ <clear/>
+ <add namespace="System"/>
+ <add namespace="System.Collections"/>
+ <add namespace="System.Collections.Specialized"/>
+ <add namespace="System.Configuration"/>
+ <add namespace="System.Text"/>
+ <add namespace="System.Text.RegularExpressions"/>
+ <add namespace="System.Web"/>
+ <add namespace="System.Web.Caching"/>
+ <add namespace="System.Web.SessionState"/>
+ <add namespace="System.Web.Security"/>
+ <add namespace="System.Web.Profile"/>
+ <add namespace="System.Web.UI"/>
+ <add namespace="System.Web.UI.WebControls"/>
+ <add namespace="System.Web.UI.WebControls.WebParts"/>
+ <add namespace="System.Web.UI.HtmlControls"/>
+ </namespaces>
+ <controls>
+ <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
+ </controls>
+ </pages>
+ <!--
+ The <authentication> section enables configuration
+ of the security authentication mode used by
+ ASP.NET to identify an incoming user.
+ -->
+ <authentication mode="Windows"/>
+ <!--
+ The <customErrors> section enables configuration
+ of what to do if/when an unhandled error occurs
+ during the execution of a request. Specifically,
+ it enables developers to configure html error pages
+ to be displayed in place of a error stack trace.
+
+ <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
+ <error statusCode="403" redirect="NoAccess.htm" />
+ <error statusCode="404" redirect="FileNotFound.htm" />
+ </customErrors>
+ -->
+ </system.web>
+</configuration>