Cerco di spiegarmi meglio:
Default.aspx:
codice:
<%@ Register TagPrefix="template" TagName="body" Src="Body.ascx" %>
void Page_Load(Object Sender, EventArgs E) {
[omissis]
if (dataReader.HasRows) {
while (dataReader.Read())
body.colore = ((i%2)==0) ? "#f0f0ff" : "#e6dcd7";
body.id = dataReader.GetInt32(0);
body.caller = dataReader.GetString(1);
i++;
}
}
}
<table style="width: 100%">
<template:body id="body" runat="SERVER" />
</table>
Body.ascx:
codice:
<%@ Control Language="C#" %>
<script runat="server">
public int id = 0;
public int border = 1;
public string caller = "Numero del chiamante";
public string colore = "#f0f0ff";
</script>
<tr valign="top">
<td style="border-bottom: <%=border%>px #73a5ff solid; border-right: 1px #73a5ff solid; color: #000000; font: bold 10px tahoma, verdana, sans-serif; width: 10%; background-color: <%=colore%>;"><input type="checkbox" name="calls[]" value="<%=id%>" /></td>
<td style="padding-left: 3px; padding-top: 3px; border-bottom: <%=border%>px #73a5ff solid; color: #000000; font: bold 10px tahoma, verdana, sans-serif; width: 90%; background-color: <%=colore%>;"><%=caller%></td>
</tr>
E' una cosa fattibile?