使用Handler.ashx时JQuery无法正常运行 [英] JQuery not Running Properly while using Handler.ashx

查看:55
本文介绍了使用Handler.ashx时JQuery无法正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是ASP.Net的新手。我在ASP.Net(C#)项目中加载搜索框时遇到问题。它甚至没有显示无法加载脚本等错误....它只是保持静态。我在我的项目中使用母版页。这可能导致???



我的代码如下......请帮帮我





Im newer to ASP.Net . I have an problem in loading search box in my ASP.Net(C#) project. Its not even shows errors like "Cannot load Script".... its just remains static. Im using "Master Page" in my project. This may cause???

My code is below... Please help me out

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<pre lang="xml"><link href="../../StyleSheets/SearchScript/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script src="../../StyleSheets/SearchScript/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="../../StyleSheets/SearchScript/jquery.autocomplete.js" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function() {
        $("#<%=txt_Sup_name.ClientID%>").autocomplete(''Handler.ashx'');
    });
</script>




</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Adminmaster" Runat="Server">
<asp:TextBox ID="txt_Sup_name" runat="server"></asp:TextBox>

推荐答案

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


(#<%= txt_Sup_name。的ClientID%GT。;)自动完成( '' Handler.ashx '');
});
< / script>
("#<%=txt_Sup_name.ClientID%>").autocomplete(''Handler.ashx''); }); </script>




</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Adminmaster" Runat="Server">
<asp:TextBox ID="txt_Sup_name" runat="server"></asp:TextBox>


嘿使用ajax调用处理程序(ashx)读取响应为json并将其用作源。

使用下面的链接进行自动完成。

http://jqueryui.com/autocomplete/#default [ ^ ]



使用jquery调用ajax参考下面链接:

ASP.NET高级通用处理程序ASHX [ ^ ]
hey use ajax to call handler(ashx) read response as json and use it as source.
use below link for autocomplete.
http://jqueryui.com/autocomplete/#default[^]

for calling ajax using jquery refer below link:
ASP.NET Advanced Generic Handler ASHX[^]


这篇关于使用Handler.ashx时JQuery无法正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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