1:html代码:
<table id="tbList" cellspacing="0">
   <tr>
     <td><input id="Checkbox1" type="checkbox" title="全选/全不选" /></td>
     <td width="80px">栏目编号</td>
     <td>栏目连接</td> 
     <td>栏目排序</td>-->
     <td width="140px">栏目名称</td>
     <td width="70px">栏目图片</td>
     <td width="90px">操作</td>
   </tr>  
  </table>
  <div id="opePannel">
     栏目连接:<input type="text" id="txtName" /><br />
     栏目名称:<input type="text" id="txtPwd" /><br />
     <input type="button" value="确定" id="btnOK" />
     <input type="button" value="取消" id="btnCancel" />
  </div>
///////////////////////////////////////////////////////////////////
js: var cId=-1;      //定义一个全局变量cId  是修改还是删除的标识 
       //修改(包括新增,修改)方法操作
       function doOpeAddModify(){
          if(cId>-1){    //修改操作                
             xhr.open("post","list.ashx?do=m",true);
             xhr.setRequestHeader("Content-type","application/x-www-form-urlencode");
             xhr.onreadystatechange=function(){
                 if(xhr.readyState==4){
                    if(xhr.status==200){
                       var res=xhr.responseText;
                       alert(res);
                    }
                 }
             }
   var  data="BoardId="+cId+"&cName="+encodeURI(document.getElementById("txtName").value)+"&cPwd="+encodeURI(document.getElementById("txtPwd").value)+"";
             xhr.send(data);     //发送的数据data          }else{ //新增操作
          
          }
       
       }
///////////////////////////////////////////////////////////
list.ashx服务端:
string strDo = context.Request.Params["do"];    
            switch (strDo)
            {
                case "l":   //处理分页数据
                    GetPagedList(context);
                    break;
                case "d":   //处理删除业务
                    SoftDell(context);
                    break;
                case "m":   //处理修改业务
                    Modify(context);
                    break;
                case "a":   //处理新增业务                
                    break;
            } //修改业务方法
        void Modify(HttpContext context)
        {         
            //在调试的时候strId strNmae  strPwd 获取不到post传的值,老是显示为null
            string strId = context.Request.Form["BoardId"];
            string strNmae = context.Request.Form["cName"];
            string strPwd = context.Request.Form["cPwd"];            string sqlstr = "update board set BoardURL=" + strNmae + ", BoardText=" + strPwd + " where BoardId=" + strId + "";
            Common common = new Common();
            int result = common.ExecuteNonQuery(sqlstr);            if (result!=-1)
            {
                //修改成功
                context.Response.Write("{status:1}");
            }
            else
            {
                //修改失败
                context.Response.Write("{status:0}");
            }
           
        }