.Click()无法与Button一起使用 [英] .Click() not working with Button
本文介绍了.Click()无法与Button一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#Submit1").click(function () {
$.ajax({
contentType: "text/html; charset=utf-8",
data: {ID: $('#Text1').val(),
ID2: $('#Text2').val()
},
url: "fetchcustomer.aspx",
dataType: "html",
success: function (data) {
$("#CustomerDetails").html(data);
}
});
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Submit1" type="submit" value="submit" />
<div id="CustomerDetails">
</div>
<input id="Text1" type="text" value="thaihcm@aol.com" />
<input id="Text2" type="text" value="111222" />
</form>
</body>
</html>
大家好,
我不知道为什么当我单击按钮"submit1"时它不起作用.
请帮忙.
Hi all,
I dont know why when i click button "submit1" it''s not working.
pls help.
推荐答案
(文档).ready(函数(){
(document).ready(function () {
(" ).click(函数(){
("#Submit1").click(function () {
.ajax({ contentType:" , 数据:{ID:
.ajax({ contentType: "text/html; charset=utf-8", data: {ID:
这篇关于.Click()无法与Button一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文