当前位置:编程学习 > C#/ASP.NET >>

GridView js获取选中行数据---最后一行无法获取

   如题,菜鸟恳求高手协助。js获取其他行数据时均可正常显示,唯独最后一行时,没有反应,也不会运行到js处。附上相关code:
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    string EquipmentName = ((equipDetails)e.Row.DataItem).EquipmentName.ToString();
                    string Model = ((equipDetails)e.Row.DataItem).Model.ToString();
                    string SerialNo = ((equipDetails)e.Row.DataItem).SerialNo.ToString();
                    string CalibrationType = ((equipDetails)e.Row.DataItem).CalibrationType.ToString();
                    string Frequency = ((equipDetails)e.Row.DataItem).Frequency.ToString();
                    string CertStatus = ((equipDetails)e.Row.DataItem).CertStatus.ToString();
                    string CaliLabel = ((equipDetails)e.Row.DataItem).CaliLabel.ToString();
                    string WaiverNo = ((equipDetails)e.Row.DataItem).WaiverNo.ToString();
                    string CaliDate = ((equipDetails)e.Row.DataItem).CaliDate.ToString();
                    string DueDate = ((equipDetails)e.Row.DataItem).DueDate.ToString();
                    string Alarm = ((equipDetails)e.Row.DataItem).Alarm.ToString();
                    string AssertNo = ((equipDetails)e.Row.DataItem).AssertNo.ToString();
                    string CustomNo = ((equipDetails)e.Row.DataItem).CustomNo.ToString();
                    string Remark = ((equipDetails)e.Row.DataItem).Remark.ToString();
                    string equipState = ((equipDetails)e.Row.DataItem).EquipmentState.ToString();
                    string assetOwner = ((equipDetails)e.Row.DataItem).assetOwner.ToString();
                    e.Row.Attributes.Add("onclick", "getRowValue('" + EquipmentName + "','" + Model + "','" + SerialNo + "','" + CalibrationType + "','" + Frequency +
                                          "','" + CertStatus + "','" + CaliLabel + "','" + WaiverNo + "','" + CaliDate + "','" +
                                          DueDate + "','" + Alarm + "','" + AssertNo + "','" + CustomNo + "','" + equipState + "','" + Remark + "','" + assetOwner + "');if(window.oldtr!=null){window.oldtr.runtimeStyle.cssText='';} this.runtimeStyle.cssText='background-color:#E6C5FC';window.oldtr=this;");
                }

JS  code:
        function getRowValue(s2, s3, s4, m, m1, m2, m3, m4, n, n1, n2, n3, n4, n6, n5, n7) {
          document.getElementById("<%= txtEquipmentName.ClientID %>").value = s2;
          document.getElementById("<%= txtModel.ClientID %>").value = s3;
          document.getElementById("<%= txtSerialNo.ClientID %>").value = s4;
          document.getElementById("<%= txtCalibrationType.ClientID %>").value = m;
          document.getElementById("<%= txtFrequency.ClientID %>").value = m1;
          document.getElementById("<%= txtCertStatus.ClientID %>").value = m2;
          document.getElementById("<%= txtCaliLabel.ClientID %>").value = m3;
          document.getElementById("<%= txtWaiverNo.ClientID %>").value = m4;
          document.getElementById("txtCaliDate").value = n;
          document.getElementById("txtDueDate").value = n1;
          document.getElementById("<%= txtAlarm.ClientID %>").value = n2;
          document.getElementById("<%= txtAssetNo.ClientID %>").value = n3;
          document.getElementById("<%= txtCustomNo.ClientID %>").value = n4;
          document.getElementById("<%= drpEquipState.ClientID %>").value=n6;
          document.getElementById("<%= txtRemark.ClientID %>").value = n5;
          document.getElementById("<%= drpAssetOwner.ClientID %>").value = n7;
          document.getElementById("<%= btnNewSave.ClientID %>").disabled = true;
          document.getElementById("<%= btnEditSave.ClientID %>").disabled = false;
          document.getElementById("<%= txtModel.ClientID %>").setAttribute("ReadOnly", true);
          document.getElementById("<%= txtSerialNo.ClientID %>").setAttribute("ReadOnly", true);
      }
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,