Click here to Skip to main content
15,919,434 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I need to call a handler (ashx) file from jQuery to fetch some data at runtime. My jQuery function looks like:
XML
<script src="./Scripts/Jcrop/js/jquery.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
     $("#txtCardHolderName_LL").keyup(function () {

            $.ajax({
                url: "HandlerHinditoEnglish.ashx",
                type: "POST",

                success: function (data) {
                    alert(data);

                },
                error: function (data) {
                    alert("Error");
                }
            });
        });
    </script>


Handler code
C#
public void ProcessRequest(HttpContext context)
   {
       context.Response.ContentType = "text/plain";
       context.Response.Write("Hello World");
   }

   public bool IsReusable
   {
       get
       {
           return false;
       }
   }


But it is not firing on key up of textbox please help i need to all handler function onkeyup of my textbox.
Posted
v2
Comments
Pratika05 22-Nov-12 7:23am    
hey i solved this by puutin script at bottom of page after body tag now i aslso want to pass some parameters to handler and show result returned by handler pls help me

1 solution

Please refer the articles below for your requirements.

1. Use ASP.NET’s HttpHandler to bridge the cross-domain gap[^].
2. ASP.NET Advanced Generic Handler ASHX[^]. Go through it and download the source code[^] to see how exactly it is implemented.
3. jQuery + Ajax + ASP.NET Generic Handler = Interactivity and Performance [^]
4. Troubleshooting jQuery AJAX call using Generic Handler in ASP.NET[^]. The question contains the implementations.

Thanks...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900