使用< form>时jquery无法正常工作标签 [英] jquery not working while using <form> tag

查看:86
本文介绍了使用< form>时jquery无法正常工作标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在asp.net控件中使用表单标签时,Jquery不是wrking。所以解决方案是什么。我正在尝试多种技术但它不起作用。



<%@ Page Language =C#AutoEventWireup =trueCodeFile =Default.aspx.csInherits =_ Default%>



< ;!DOCTYPE html>



< html xmlns =http://www.w3.org/1999/xhtml>

< head runat =server>

< title>< / title>

< script src =http://ajax.googleapis。 com / ajax / libs / jquery / 1.11.1 / jquery.min.js>< / script>

< script type =text / javascript>

$(document).ready(function(){

$(#bt1)。click(function(){

$(#p1 ).hide(2000);

});

});

< / script>

< / head>

< body>

< form id =form1runat =server>

Jquery is not wrking when I am using form tag in asp.net controls.so whats the solution .I am trying multiple techniques but it does not work.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#bt1").click(function () {
$("#p1").hide(2000);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">


< p runat =serverid =p1>这是asp.net

< asp:按钮ID =bt1Text =click runat =server/>


<p runat="server" id="p1">this is asp.net
<asp:Button ID="bt1" Text="click" runat="server"/>



< / form>

< / body>

< / html>


</form>
</body>
</html>

推荐答案

(document).ready(function(){
(document).ready(function () {


(#bt1)。click(function(){
("#bt1").click(function () {


(#p1)。hide(2000);

} );

});

< / script>

< / head>

< body> ;

< form id =form1runat =server>

("#p1").hide(2000);
});
});
</script>
</head>
<body>
<form id="form1" runat="server">


< p runat =server id =p1>这是asp.net

< asp:按钮ID =bt1Text =clickrunat =server/>


<p runat="server" id="p1">this is asp.net
<asp:Button ID="bt1" Text="click" runat="server"/>



< / form>

< / body>

< / html>


</form>
</body>
</html>


这篇关于使用&lt; form&gt;时jquery无法正常工作标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆