(Sender As Object, E As DataGridCommandEventArgs)
Dim CurrentTextBox As System.Web.UI.WebControls.TextBox
CurrentTextBox = E.Item.Cells(I).Controls(0)
Dim ColValue As String = CurrentTextBox.Text
Dim CurrentTextBox As System.Web.UI.WebControls.TextBox
CurrentTextBox = E.Item.Cells(I).Controls(0)
Dim ColValue As String = CurrentTextBox.Text
string value;
box=e.Item.Cells[0].Controls[0];
value=box.Text;
在 DataGrid的 ItemDataBound()事件里
{
if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.Alternater)
{
string sScript = "<script language=javascript>"
sScript += "alert('" + e.Item.Cells[0].Text +"')";
sScript += "</";
sScript += "script>
e.Item.Attributes["OnClick"] = str;
}
}
Alternater 编译出错
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string sScript = "javascript:";
sScript += "alert('" + e.Item.Cells[0].Text +"');";
e.Item.Attributes["onClick"] = sScript;
}
}