-2

I have a HTTP handler (.ashx) which generates some html code from database and I want to call it from my Jquery function and pass a value (userID).

I am not sure how to call it and retrieve its data.

Michaël
  • 3,679
  • 7
  • 39
  • 64
amir moradifard
  • 353
  • 1
  • 8
  • 26
  • 1
    Use Google. It's faster that creating new question! Especially that first link in search result describe everything well. – Misiu Mar 08 '13 at 07:55

2 Answers2

7

something like this.

$(document).ready(function() {

    $.get("http://path/to/handler.ashx", function(html) {
        alert(html);
    });

});
Al W
  • 7,539
  • 1
  • 19
  • 40
4

Use Google - first site after typing jquery ashx - https://sites.google.com/site/spyderhoodcommunity/tech-stuff/usingjqueryinaspnetappswithhttphandlersashx

Misiu
  • 4,738
  • 21
  • 94
  • 198
  • The second link that came up was for this question. I trust SO over the first link so maybe this "answer" isn't deserved after all?? – Kristopher Jan 08 '14 at 22:32
  • @Wartickler have You event read that article? This is basically the same code, but with description. I give Amir link with something I found on Google in 5 seconds. Point was to show how easy it was to find solution just by typing 2 words in google. My answer is correct, and because You think SO is better (I also think SO is grate) doesn't mean You should downvote someones answer. – Misiu Jan 09 '14 at 07:47
  • You know what, you're right. This is actually an answer. My apologies, as I was downvoting what appeared to be a bad attitude. I'm trying to upvate the answer again but it's past 16 hours which means I can't change my vote unless you "edit" your answer. My bad... ): – Kristopher Jan 09 '14 at 14:52
  • @Wartickler I glad You got my point :) If it is not a problem please remove Your downvote. – Misiu Jan 10 '14 at 09:29
  • I'm trying to do so but the message i get is as thus: "You last voted on this answer yesterday. Your vote is now locked in unless this answer is edited." @misiu If you edit your answer in some way I can change this for you. – Kristopher Jan 10 '14 at 15:52