I've tried both BrowserCap & uplevel with no differences.
I've cut & paste the aspx & code behind file
I appreciate all the time you've spent on this, but perhaps we both spent too much time on this!
<%@ Page language="c#" Codebehind="DataGrid.aspx.cs" AutoEventWireup="false" Inherits="MCSDWebAppsCS.DataGridForm" %>
<%@ Register TagPrefix="uc1" TagName="footercs" Src="../footercs.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Adding Items to a DataGrid</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript (ECMAScript)">
<meta name="vs_targetSchema" content="
http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="DataGrid" method="post" runat="server">
<h2>Adding Items to a DataGrid</h2>
<hr>
<asp

ataGrid id="DataGrid2" runat="server" DataSource="<%# arrData %>" Height="46px" Width="83px" ShowHeader="False">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox id=TextBox2 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="" CancelText="" EditText="Change"></asp:EditCommandColumn>
</Columns>
</asp

ataGrid>
<uc1:footercs id="Footercs1" runat="server" />
<asp

ataGrid id=DataGrid1 runat="server" ShowHeader="False" DataSource="<%# arrData %>">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox id=TextBox1 runat="server" Text='<%# DataBinder.Eval(Container, "DataItem") %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" CancelText="Cancel" EditText="Edit"></asp:EditCommandColumn>
</Columns>
</asp

ataGrid>
<asp:TextBox id=TextBox3 runat="server" ReadOnly="True">ReadOnly</asp:TextBox>
<asp:TextBox id=TextBox4 runat="server" Enabled="False">Not Enabled</asp:TextBox>
<asp:TextBox id=TextBox5 runat="server">Required</asp:TextBox>
<asp:RequiredFieldValidator id=RequiredFieldValidator1 runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="TextBox5" EnableClientScript="False">Required!</asp:RequiredFieldValidator>
<asp:TextBox id=TextBox6 runat="server">RunTime R/O</asp:TextBox>
<asp:TextBox id=TextBox7 runat="server">Run Time Disabled</asp:TextBox><INPUT type=submit value=Submit>
</form>
</body>
</HTML>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace MCSDWebAppsCS
{
/// <summary>
/// Summary description for DataGrid.
/// </summary>
public class DataGridForm : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid DataGrid2;
public DataGridForm()
{
Page.Init += new System.EventHandler(Page_Init);
}
protected System.Web.UI.WebControls.DataGrid DataGrid1;
protected System.Web.UI.WebControls.TextBox TextBox3;
protected System.Web.UI.WebControls.TextBox TextBox4;
protected System.Web.UI.WebControls.TextBox TextBox5;
protected System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
protected System.Web.UI.WebControls.TextBox TextBox6;
protected System.Web.UI.WebControls.TextBox TextBox7;
// Public data item for DropDownList.
public string[] arrData = {"This", "that", "and", "the", "other"};
private void Page_Load(object sender, System.EventArgs e)
{
// The first time the page is displayed...
if (!IsPostBack)
// Update the datagrid.
Page.DataBind();
}
private void Page_Init(object sender, EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
}
#region Web Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.DataGrid2.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2_EditCommand);
this.DataGrid1.ItemCreated += new System.Web.UI.WebControls.DataGridItemEventHandler(this.DataGrid1_ItemCreated);
this.DataGrid1.EditCommand += new System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid2_EditCommand);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void DataGrid2_EditCommand(object source, DataGridCommandEventArgs e)
{
// Update the text in column 3 with the text from the edit field in column 1.
e.Item.Cells[2].Text = ((TextBox)e.Item.Cells[0].Controls[1]).Text;
}
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
int i = e.Item.Cells.Count;
e.Item.Cells[0].Enabled = false; // disabled controls are NOT rebound
TextBox6.ReadOnly = true;
TextBox7.Enabled = false;
}
}
}
In Mozilla, if you want an input text field as readonly you might have better luck with the readonly attribute (ie. readonly="readonly"); assuming XHMTL 1.0; but 4.01 quirks mode is probably the same.
The second bit of HTML is broken; why don't you post the Grid template. Also, make sure you install the browserCaps update -- this is important since ASP.NET will probably revert to the 3.2 HTML writer for 1.(6|7). If you don't want to do a browserCaps; then look at setting your clientTarget to uplevel.
Scott
An update to my first reply:
I've just installed Mozilla 1.7b - and no difference in enabled = false working
When enabled = false does work, the disabled attribue is IN the <input definition:
<input name="TextBox7" type="text" value="Run Time Disabled" id="TextBox7" disabled="disabled" /><INPUT type=submit value=Submit>
When enabled = false does NOT work (e.g. my textbox embedded in a DataGrid, i.e. the textbox is in an HTML table),
the disabled attribute is in never-never land as part of the <td, not part of the <input:
<tr>
<td disabled="disabled">
<input name="DataGrid1:_ctl5:TextBox1" type="text" value="the" id="DataGrid1__ctl5_TextBox1" />
</td>
</tr>
First, what versions of Netscape are you working with? For anything around 4.x or even 6.x you have my sympathy.
For modern Gecko Netscapes (and Mozilla) we have pretty good results. All of our developers use Mozilla 1.7 for development and we backport to IE. We write to XHTML 1.0 transitional (and set a doctype for that); sometimes we use HTML 4.0. To do this you need an up to date browserCap (see
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=89874).
I don't often use the built in ASP.NET validation scheme (Whidbey is a much better design); but you are right, ASP.NET doesn't include client side validation for non-IE browsers. There is at least on add on product to do this (see
http://www.peterblum.com/VAM/Home.aspx)
I don't have any problems with readonly for a textbox in Mozilla; what does the generated HTML look like?
Scott
I have stumbled across various Netscape issues, none of which appear to be
solvable by tweaking the clientTarget or targetSchema properties. At this
point, I'm not even interested in "solving" these problems - I'm more
interested in isolating them, .i.e. finding a "complete" list of issues.
Here's my list of serious issues found so far. By serious, I mean
functionality that fails, as opposed to much less serious (albeit annoying)
display appearance issues.
1) Run time changing of the enabled (or readOnly) property does NOT work in
Netscape under some circumstances - e.g. using a templated textbox in a
DataGrid
2) Validators don't work under any circumstances.
Someone correct me if I'm wrong, but this strikes me as a classic "brick
wall" problem - asp.net will get you very easily to 90% browser
independence, but when you need the last 10% you hit the brick wall, i.e.
there is no way to tweak asp.net to get you the least 10% - you have to
abandon it significantly - by writing your own complex JavaScript, or maybe
even abandon it completely - and go to Java.