设置linkButton的属性 CommandArgument='<%# Eval("id") %>' CommandName="del"
然后写datalist的ItemCommand事件,代码如下:
protected void dlnews_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "del")
{
//引用类
BLL.New n = new Maticsoft.BLL.New();
//完成删除功能
n.Delete(int.Parse(e.CommandArgument.ToString()));
//删除后重新绑定下datalist
BandNews();
}
}
在点击事件用window.open方法试试,
Response.Write("")
在javascript中写:
function TransferTo()
{
window.open('" + i_url + "','_blank');
window.event.returnValue=false;//不刷新网页
}