Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi all,
I need to call a handler (ashx) file from jQuery to fetch some data at runtime. My jQuery function looks like:
<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
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 22-Nov-12 2:04am
v2
Comments
Pratika05 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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...
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 7,740
1 DamithSL 5,769
2 Sergey Alexandrovich Kryukov 5,424
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 22 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100