2

I'm trying to create a web forms server control and really wanted to leverage jQuery to handle the client side interaction.

So far I've not found any examples to being able to directly call a server control using the jQuery .ajax functionality and I'm wondering is it even possible?

I know I could go down the web service or Http Handler route but my aim is to create a control that can be dropped into existing sites and utilise session but with no intention of needing to use ViewState.

Can this be done? or do I have to use the ScriptControl and Asp.Net Ajax functionality?

Nathan
  • 931
  • 1
  • 12
  • 26

1 Answers1

1

Unfortunately, no.

Probably the closest is to create an HttpHandler class and include it in your server control's DLL. Then, you'll only need a single line added to your web.config to wire the handler class up to an endpoint that jQuery can communicate with.

Dave Ward
  • 59,815
  • 13
  • 117
  • 134
  • Thanks for that Dave, I hadn't considered a Http Handler included with the server control. I shall have to give that a go. – Nathan Dec 16 '10 at 20:47