[Mono-list] Javascript library no longer available in Mono 1.1.9.1

Carl Olsen carl at carl-olsen.com
Wed Oct 5 07:27:56 EDT 2005


Why doesn't this work in Mono 1.1.9.1?

Here is the code for my two files:

<%@ Page language="c#" AutoEventWireup="false"
Inherits="CarlsWebs.CarlOlsen.Web.TestPage" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
	<head>
		<title>TestPage</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET
7.1">
		<meta name="CODE_LANGUAGE" content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
	</head>
	<body>
		<form id="Form1" method="post" runat="server">
			<asp:datagrid id="DataGrid1" runat="server"
autogeneratecolumns="False" bordercolor="Tan" borderwidth="1px"
				backcolor="LightGoldenrodYellow"
cellpadding="2" gridlines="None" forecolor="Black">
				<footerstyle backcolor="Tan"></footerstyle>
				<selecteditemstyle forecolor="GhostWhite"
backcolor="DarkSlateBlue"></selecteditemstyle>
				<alternatingitemstyle
backcolor="PaleGoldenrod"></alternatingitemstyle>
				<headerstyle font-bold="True"
backcolor="Tan"></headerstyle>
				<columns>
					<asp:editcommandcolumn
buttontype="LinkButton" updatetext="Update" canceltext="Cancel"
edittext="Edit"></asp:editcommandcolumn>
					<asp:buttoncolumn text="Delete"
commandname="Delete"></asp:buttoncolumn>
					<asp:boundcolumn datafield="ID"
headertext="ID"></asp:boundcolumn>
					<asp:boundcolumn datafield="Title"
headertext="Title"></asp:boundcolumn>
					<asp:buttoncolumn text="Select"
commandname="Select"></asp:buttoncolumn>
				</columns>
				<pagerstyle horizontalalign="Center"
forecolor="DarkSlateBlue" backcolor="PaleGoldenrod"></pagerstyle>
			</asp:datagrid>
			<br clear="all" />
			<asp:label id="ShowResults" runat="server" />
		</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 CarlsWebs.CarlOlsen.Web
{
	public class TestPage : System.Web.UI.Page
	{
		protected System.Web.UI.WebControls.DataGrid DataGrid1;
		protected System.Web.UI.WebControls.Label ShowResults;
	
		private void Page_Load(object sender, System.EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				ShowResults.Text = "";
				BindData();
			}
		}

		private void BindData()
		{
			DataTable test = new DataTable("Test");
			DataColumnCollection cols = test.Columns;
			cols.Add("ID", typeof(System.Int32));
			cols.Add("Title", typeof(System.String)).MaxLength =
400;
			DataRow row1 = test.NewRow();
			row1["ID"] = 1;
			row1["Title"] = "This is row 1";
			test.Rows.Add(row1);
			DataRow row2 = test.NewRow();
			row2["ID"] = 2;
			row2["Title"] = "This is row 2";
			test.Rows.Add(row2);
			DataRow row3 = test.NewRow();
			row3["ID"] = 3;
			row3["Title"] = "This is row 3";
			test.Rows.Add(row3);
			DataRow row4 = test.NewRow();
			row4["ID"] = 4;
			row4["Title"] = "This is row 4";
			test.Rows.Add(row4);
			DataGrid1.DataSource = test;
			DataGrid1.DataBind();
		}

		override protected void OnInit(EventArgs e)
		{
			InitializeComponent();
			base.OnInit(e);
		}
		
		private void InitializeComponent()
		{    
			this.DataGrid1.CancelCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_CancelC
ommand);
			this.DataGrid1.EditCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_EditCom
mand);
			this.DataGrid1.UpdateCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_UpdateC
ommand);
			this.DataGrid1.DeleteCommand += new
System.Web.UI.WebControls.DataGridCommandEventHandler(this.DataGrid1_DeleteC
ommand);
			this.DataGrid1.SelectedIndexChanged += new
System.EventHandler(this.DataGrid1_SelectedIndexChanged);
			this.Load += new
System.EventHandler(this.Page_Load);

		}

		private void DataGrid1_SelectedIndexChanged(object sender,
System.EventArgs e)
		{
			ShowResults.Text = "You selected index " +
DataGrid1.SelectedIndex.ToString();
		}

		private void DataGrid1_CancelCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
			ShowResults.Text = "";
			DataGrid1.SelectedIndex = -1;
			BindData();
		}

		private void DataGrid1_DeleteCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
			ShowResults.Text = "";
			DataGrid1.SelectedIndex = -1;
			BindData();
		}

		private void DataGrid1_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
			ShowResults.Text = "";
			DataGrid1.SelectedIndex = -1;
			BindData();
		}

		private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
		{
			ShowResults.Text = "";
			DataGrid1.SelectedIndex = -1;
			BindData();
		}
	}
}

-----Original Message-----
From: mono-list-bounces at lists.ximian.com
[mailto:mono-list-bounces at lists.ximian.com] On Behalf Of Carl Olsen
Sent: Monday, October 03, 2005 8:31 PM
To: mono-list at lists.ximian.com
Subject: RE: [Mono-list] Javascript library no longer available in Mono
1.1.9.1

I stand corrected.  Mono 1.1.9.1 is actually inserting javascript into the
bottom of my page, like this:

		<input type="hidden" name="__EVENTTARGET" value="" />
	<input type="hidden" name="__EVENTARGUMENT" value="" />
	
	<script language="javascript">
	<!--
		var theForm = document.getElementById ('Form1');
		function __doPostBack(eventTarget, eventArgument) {
			theForm.__EVENTTARGET.value = eventTarget;
			theForm.__EVENTARGUMENT.value = eventArgument;
			theForm.submit();
		}
	// -->
	</script>

However, it is still not working correctly.  It seems to work when I sort
the columns, but not when I try to select a record and display the record
details at the top of the page.




More information about the Mono-list mailing list