Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<!-- bug 49091 -->
<%@ Page language="c#" %>
<html>
<head>
<script runat="server">
private void BtnDisable_Click(object sender, System.EventArgs e)
{
CheckBox1.Enabled = false;
}
private void BtnEnable_Click(object sender, System.EventArgs e)
{
CheckBox1.Enabled = true;
}
</script>
</head>
<body>
<p>Check the checkbox, click disable then enable. The checkbox should stay enabled.</p>
<form runat="server">
<asp:checkbox id="CheckBox1" runat="server" Text="Test" />
<asp:button onclick="BtnDisable_Click" runat="server" Text="Disable" />
<asp:button onclick="BtnEnable_Click" runat="server" Text="Enable" />
</form>
</body>
</html>

View File

@@ -0,0 +1,76 @@
<!--
In this case, we have a checkbox inside a repeater control, which is a
naming container. We need to make sure to use the correct attribute on
the label element so that the browser knows how to hook up the label
and the widget.
-->
<%@ Page Language="C#" AutoEventWireup="True" %>
<%@ Import Namespace="System.Data" %>
<html>
<head>
<script runat="server">
void Page_Load (object s, EventArgs e)
{
if (IsPostBack)
return;
DataTable t = new DataTable ("t");
t.Columns.Add (new DataColumn ("Symbol", typeof (string)));
t.Columns.Add (new DataColumn ("Company", typeof (string)));
t.Columns.Add (new DataColumn ("Price", typeof (double)));
DataSet ds = new DataSet ("ds");
ds.Tables.Add (t);
AddStock (t, "MSFT", "Microsoft Corp.", 25.81);
AddStock (t, "NOVL", "Novell Inc.", 6.17);
AddStock (t, "GOOG", "Google", 300.95);
rep.DataSource = ds;
rep.DataMember = "t";
rep.DataBind ();
}
void AddStock (DataTable dt, string symbol, string co, double price)
{
DataRow dr = dt.NewRow ();
dr [0] = symbol;
dr [1] = co;
dr [2] = price;
dt.Rows.Add (dr);
}
</script>
</head>
<body>
<asp:Label id="lbl1" runat="server" />
<form runat="server">
<asp:Repeater id="rep" runat="server">
<HeaderTemplate>
<table>
<thead>
<tr>
<td>Stock</td>
<td>Company</td>
<td>Price</td>
<td>Buy</td>
</tr>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval (Container.DataItem, "Symbol") %></td>
<td><%# DataBinder.Eval (Container.DataItem, "Company") %></td>
<td><%# DataBinder.Eval (Container.DataItem, "Price") %></td>
<td><asp:checkbox id="buy" runat="server" text="Buy"/></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</form>
</body>
</html>

View File

@@ -0,0 +1,62 @@
<%@ Page Language="C#" Debug="true" %>
<html>
<head>
<title>CheckBox viewstates</title>
<script runat="server">
void Page_Load ()
{
label.Text = String.Format ("Version: {0}<br>", Environment.Version);
// Viewstate
MyCheckBox myc = new MyCheckBox ();
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
myc.AutoPostBack = true;
myc.Checked = true;
myc.Text = "wibble";
myc.TextAlign = TextAlign.Left;
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
myc.TextAlign = TextAlign.Right;
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
myc.Checked = false;
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
myc.AutoPostBack = false;
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
myc.Text = null;
label.Text += "<hr>";
label.Text += myc.GetVSItems ();
panel.Controls.Add (myc);
}
class MyCheckBox : CheckBox {
public string GetVSItems ()
{
StringBuilder sb = new StringBuilder ();
sb.AppendFormat ("Count: {0}<br>", ViewState.Count);
foreach (string o in ViewState.Keys) {
sb.AppendFormat ("{0}: {1}<br>", o, ViewState [o]);
}
return sb.ToString ();
}
}
</script>
</head>
<body>
This test shows default property values.
<br>
<form runat="server">
<asp:Label runat="server" id="label" />
<hr>
<asp:Panel runat="server" id="panel" />
<hr>
</form>
</body>
</html>