codice:
<%@ Page Language="C#" %>
<%@ Import Namespace="l=libreria.ModuloWeb" %>
<!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 Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
l.DataBind(this.DataGrid1, MioModulo.StringaConnessioneTest, "select * from campi", null);
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Pagina senza titolo</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="DataGrid1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundColumn DataField="id"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Visible='<%# (Eval("Long") == DBNull.Value)? false:true %>'></asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%#Eval("Long") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</div>
</form>
</body>
</html>