1.use client script in the aspx page
2.use validator control
3.write client script by codebehind,for example there is a button named button1you can write the code ***button1.attribute("onclick")="javascript:alert('aaa')" in the cs file
2.use validator control
3.write client script by codebehind,for example there is a button named button1you can write the code ***button1.attribute("onclick")="javascript:alert('aaa')" in the cs file
解决方案 »
- 求中型网站服务器架构方案
- 关于sql2005的sql的问题,急急急,在线等!
- 这个sql查询可以再快点不?
- 困扰的数据连接问题
- 在线等SuperAuthenticationCode验证证控件在iis中不显示验证码问题
- ASP.NET2.0 URL 重写
- 作了一个用Js遍历2.0TreeView节点的函数,后来发现一个问题!
- 怎样判断Request.Querystring["id"]的值为有效整数?(c#)
- 一个小问题
- 一个很重要的提示功能!进来看!
- 请问在sqlconnection对象用CLOSE和不用CLOSE差别大吗?
- 用C#编写asp.net程序时,如何调用oracle 数据库?谢谢解答!
Response.Write ("<Script>");
Response.Write ("alert('是否删除?')");
Response.Write ("</Script>");
我加分就是了!!
{
if (e.Item.ItemIndex >= 0)
{
LinkButton btn = (LinkButton)e.Item.Cells[10].FindControl("Linkbutton2");
btn.Attributes.Add("onClick","javascript:return confirm('确定要删除该条记录吗?');");
}
}
10是索引号
出现如下错误
未将对象引用设置到对象的实例。
然后,确定你的“删除”的linkbutton所在的列的索引号和你程序中的是否 一致,假如你有10列,“删除”在最后一列,则索引号为9
最后,确定你的“删除”连接的id和你findcontrol()里面的参数是否一致
LinkButton btn = (LinkButton)e.Item.Cells[10].FindControl("Linkbutton2"); 这里,“删除”按钮德id是Linkbutton2在我这里运行一些正常
如何得到返回的是“确定”还是“取消”
实在是不知道findcontrol()里面的参数是什么啊!!
到那里找啊!