All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET中Server对象的方法_[Asp.Net教程]
PHP开发技巧:PHP关于图像颜色的操作_php资料_编程技术
从,PHP,迁移到,ASP.NET(1)_[Asp.Net教程]
Phalanger-PHP的.NET编译器_php资料_编程技术
sql server日志文件总结及日志满的处理办法_[SQL Server教程]
总结showModalDialog和showModelessDialog用法_JavaScript技术_编程技术
SQL,Server的恢复模式_mssql学习_编程技术
ASP.NET中web.config文件的配置_[Asp.Net教程]
visual c++中的组合框控件(Combo Box)
详细介绍动态网页PHP预定义变量之服务器变量_php资料_编程技术
Reading number is top 10 pictures
The household of rural style is designed
传销的好处
XuRe xuan cool and refreshing photoes1
乳娘帕梅拉安德森4
白嫩丰满美女照片
Breasts woman big set 2
怀春少女-石一伊
Startling Russian girl blind date scene1
In the world the most mysterious 21 place landscape3
BingBingFan apple dew point photo gallery2
Download software ranking
VC++6.0培训教程
JSP+Ajax Web development typical examples
Jinling thirteen stock
I for your crazy
Unix video tutorial19
Macromedia Dreamweaver 8
仙剑奇侠传98版歌曲
Eclipse 4.2.1 For Win32
Wild things 2
linux安装大全
归海一刀 published in(发表于) 2014/1/30 1:21:30 Edit(编辑)
ASP.net常见功能示例代码_[Asp.Net教程]

ASP.net常见功能示例代码_[Asp.Net教程]

ASP.net常见功能示例代码_[Asp.Net教程]

















1. 打开新的窗口并传送参数:

传送参数:

response.write("")


接收参数:

string a = Request.QueryString("id");
string b = Request.QueryString("id1");

2.为按钮添加对话框

Button1.Attributes.Add("onclick","return confirm(’确认?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")

3.删除表格选定记录

int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString()

4.删除表格记录警告

private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
switch(e.Item.ItemType)
{
case ListItemType.Item :
case ListItemType.AlternatingItem :
case ListItemType.EditItem:
TableCell myTableCell;
myTableCell = e.Item.Cells[14];
LinkButton myDeleteButton ;
myDeleteButton = (LinkButton)myTableCell.Controls[0];
myDeleteButton.Attributes.Add("onclick","return confirm(’您是否确定要删除这条信息’);");
break;
default:
break;
}

}

5.点击表格行链接另一页

private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//点击表格打开
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
e.Item.Attributes.Add("onclick","window.open(’Default.aspx?id=" + e.Item.Cells[0].Text + "’);");
}

双击表格连接到另一页

在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=’../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.表格超连接列传递参数

’ & name=’<%# DataBinder.Eval(Container.DataItem, "数据字段2")%>’ />
































添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.