我爱Aspx >> Asp.Net >> 初学asp.net应该记住的东西}
双击表格连接到另一页
在itemDataBind事件中
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string orderItemID =e.item.cells[1].Text;
...
e.item.Attributes.Add("ondblclick", "location.href="http://www.5iaspx.com/ShippedGrid.aspx?id=" + orderItemID + "'");
}
双击表格打开新一页
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
string orderItemID =e.item.cells[1].Text;
...
e.item.Attributes.Add("ondblclick", "open('../ShippedGrid.aspx?id=" + orderItemID + "')");
}
★特别注意:【?id=】 处不能为 【?id =】
6.表格超连接列传递参数
<asp:HyperLinkColumn Target="_blank" headertext="ID号" DataTextField="id" NavigateUrl="aaa.aspx?id='<%# DataBinder.Eval(Container.DataItem, "数据字段1")%>' & name='<%# DataBinder.Eval(Container.DataItem, "数据字段2")%>' />
7.表格点击改变颜色
if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onclick","this.style.backgroundColor='#99cc00';this.style.color='buttontext';this.style.cursor='default';");
}
写在DataGrid的_ItemDataBound里
if (e.Item.ItemType == ListItemType.Item ||e.Item.ItemType == ListItemType.AlternatingItem)
{
e.Item.Attributes.Add("onmouseover","this.style.backgroundColor='#99cc00';this.style.color='buttontext';
this.style.cursor='default';");
Ҷƪл˵?
从COM组件调用.NET组件编程实战[04-21]
缓存 ASP.NET 页的某些部分[04-21]
c#教程第一讲 开始.net探索之旅[04-21]
.net课件之多线程[04-21]
五子棋.NET源码下载[04-21]
跟我一起学.net资料(二)[04-21]
跟我一起学习.net资料(一)[04-21]
我的学习作品之酒店 管理系统 (V..[04-21]
Visual C#.NET编程精粹150例[03-18]
最优化ASP.NET ——面向对象开发..[03-18]
从前之前,后来以后[04-21]
世界上最遥远的距离[04-21]
在来三张[04-21]
从COM组件调用.NET组件编程实战[04-21]
乱画的一大堆哈哈[04-21]
我住的那栋楼下[04-21]
雨中漫步—瞬间的浪漫[04-21]
一辈子的幸福[04-21]
感悟[04-21]
鱼和水,我和你……[04-21]