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

处理asp.net的回车事件

1.添加js函数
function TextBoxEntered(buttton) {
if (event.which || event.keyCode) {
if ((event.which == 13) || (event.keyCode == 13)) {
document.getElementById(button).click();
return false;
}
}
else { return true; }

此函数能让文本框的回车事件转换为一个隐藏按钮的点击事件。
2.绑定onkeydown事件的处理函数
TextBoxX.Attributes.Add("onkeydown", "TextBoxEntered('" + ButtonX.ClientID + "')");   (.cs)
or
onkeydown = "TextBoxEntered('<%=ButtonX.ClientID%>')"   (.aspx)


相关文档:

Asp.Net Forms验证文章中最后的web.config文件

<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <system.web>
        <authorization>
            < ......

asp.net中mvc分页类

分页代码如下(PageHelper.cs):
代码
  1 using System;
  2 using System.Collections.Generic;
  3 using System.Collections.Specialized;
  4 using System.Linq;
  5 using System.Web;
   ......

VFP如何调用ASP.NET Web服务中的DataSet

一、ASP.NET Web Service代码
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data.SqlClient;
 
namespace WebService1
{
    /// <sum ......

ASP.NET中为GridView添加删除提示框

在GridView中我们可以直接添加一个CommandField删除列来删除某行信息。但为了避免误操作引起的误删除,在删除操作者让操作者再确认下,完后再进行删除。
  首先我们给我们的GridView 添加一个模板列,如下:
以下是引用片段:
<ASP:TemplateField HeaderText="Delete" ShowHeader="False">
<ItemStyle ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号