易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net 小菜鸟 必学

1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
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 ==


相关文档:

ASP.NET2.0分页技术之使用纯sql语句的双top分页篇

Repeater在前台使用比较灵活自由,但有一个问题就是Repeater不支持直接分页,这个很多人看起来就有点不想用了,但我想大家都知道GridView控件或DataGrid控件在启用自带分页的时候其实效率是非常低的,大的不说,一但到了百万级数据以后,就会感觉是多么的痛苦和无耐了,所以即使是用DataGrid(GridView)控件,高手们还是只会 ......

asp.net 写系统日志

在注册表 System->CurrentControlSet->Services->Eventlog 处选择添加系统中 AspNet 这个账户注意是在右键的 安全->权限->添加
写日志
 public static void Log(string sourceName, string message)
    {
        EventLog eventLog = null;
......

asp.net性能调校

由于asp.net 处理进程在machine.config配置文件中的配置为<processModel autoConfig="true" />,这意味着你的asp.net 应用程序使用的性能参数依赖于machine.config的配置。
下面几个参数是自动配置的:
maxWorkerThreads 和 maxIoThreads
minFreeThreads 和 minLocalRequestFreeThreads
minWorkerThreads
max ......

ASP.NET 未被授权访问所请求的资源

ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。ASP.NET 有一个在应用程序没有模拟时使用的基进程标识(通常,在 IIS 5 上为 {MACHINE}\ASPNET,在 IIS 6 上为网络服务)。如果应用程序正在通过 模拟,则标识将为匿名用户(通常为 IUSR_MACHINENAME)或经过身份验证的请求用户。
若要授予 ......

asp.net写的web service例子

第一, 新建网站,选择类型为asp.net web 服务。
系统自动为你建立了个文件service.asmx.这就是一个最简单的web service服务。你可以直接运行查看效果。
第二,我们需要的是修改service.cs中的代码,来满足我们的要求。
修改后的Service.cs中的代码为:
using System;
using System.Web;
using System.Web.Services; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号