Hi,
Just add following code
protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
{
switch (e.Item.ItemType)
{
case ListItemType.AlternatingItem:
case ListItemType.Item:
Button btn = (Button)e.Item.FindControl("DummyButton");
TextBox txt = (TextBox)e.Item.FindControl("ModelTxt");
btn.Attributes.Add("onclick", "alert('" + txt.Text + "'); return false;");
break;
}
}
Thanks,
Imdadhusen