function ResetReceivepersonID() { document.getElementById("<%=hiReceivePersonID.ClientID %>").value = null; document.getElementById("<%=LinkButton1.ClientID%>").click(); return true; }
<asp:LinkButton ID="LinkButton1" runat="server" οnclick="LinkButton1_Click" Style="display: none"></asp:LinkButton> <asp:TextBox ID="tbReceivePersonName" runat="server" ActiveStatus="(3.编制/打印成品交付单)" field="ReceivePersonName" tablename="ProductDeliverForm" CssClass="kpms-textbox-short" EnableTheming="false" οnchange="return ResetReceivepersonID();" ></asp:TextBox>
编辑文本内容后,触发linkbutton的单击事件,传到后台,执行相应的代码。protected void LinkButton1_Click(object sender, EventArgs e) { string strCustomer = string.Format(@" SELECT CustomerContacterID,CustomerEntityID,Name,CreateTime FROM CustomerContacter WHERE CustomerEntityID='{0}' ", hiCustomerEntityID.Value); DataTable dtCustomer = KPMSDB.ExecuteDataSet(CommandType.Text, strCustomer).Tables[0]; DataRow[] drowCustomer = dtCustomer.Select(string.Format(@" Name='{0}'", tbReceivePersonName.Text)); if (drowCustomer.Length > 0) { } else { string strADDCustome = string.Format(@" INSERT CustomerContacter(CustomerContacterID,CustomerEntityID,Name,CreateTime,Telephone,Mobile) SELECT NEWID(),'{0}','{1}',GETDATE(),'{2}','{3}' ", hiCustomerEntityID.Value, tbReceivePersonName.Text.Replace("'",""),tbTelephone.Text,tbMobile.Text); KPMSDB.ExecuteNonQuery(CommandType.Text, strADDCustome); this.tbSignaturePersonName.Text = tbReceivePersonName.Text.Trim().Replace("'", ""); } }
文本内容改变触发后台事件
最新推荐文章于 2019-12-30 16:35:17 发布