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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for that Dave, I hadn't considered a Http Handler included with the server control. I shall have to give that a go.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.