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

ASP.net初学者学习过程中整理的备忘录

一位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 + "');");
}
  双击表格连接到另一页,在it


相关文档:

浅谈ASP.net安全编程

在Web编程过程中,存在着很多安全隐患。比如在以前的ASP版本中,Cookie为访问者和编程者都提供了方便,并没有提供加密的功能。打开IE浏览器,选择“工具”菜单里的“Internet选项”,然后在弹出的对话框里单击“设置”按钮,选择“查看文件”按钮,在弹出的窗口中,就会显示硬盘里 ......

ASP.NET 2.0中OWC生成柱状图和饼状图

1、首先下载owc11:owc11(http://www.svnhost.cn/Download/Detail-60.shtml)
2、引用OWC:打开"解决方案资源管理器"面板,鼠标右键单击"引用",选择"添加引用"菜单,在弹出的"添加引用"对话框中单击"COM"卡片,找到"Microsoft Office Web Components 10.0(office 2003是11.0)",单击"选择"和"确定"按钮,OWC就被添加到了引 ......

asp.net实现伪静态

一,获得Mircosoft URLRewriter.dll:
获得Mircosoft URLRewriter.dll可以到http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx?mfr=true
 下载完毕后,导入工程,我这里没有对该工程做任何修改,保留了原来的重写方式,然后直接在VS2005里面生成.dll文件就可以了。
二,使用该dl ......

asp.net解压缩文件夹

需要用到第三方控件ICSharpCode.SharpZipLib.dll
using System.IO;
using System.IO.Compression;
using ICSharpCode.SharpZipLib.Zip;
using ICSharpCode.SharpZipLib.GZip;
using ICSharpCode.SharpZipLib.Checksums;  
  #region 压缩文件夹,支持递归
/// <summary>
   &nb ......

Asp.net页面之间传递参数方法

第一种方法:­
     通过URL链接地址传递­
send.aspx:­
protected void Button1_Click(object sender, EventArgs e)­
    {­
        Request.Redirect("Default2.aspx?username=honge");­
  &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号