tags:

views:

81

answers:

1

Hi,

I can't seem to get the jQuery.ajax() function posting back any of my asp.net generated form controls.

I've put a break point on the server side and there aren't any values.

Is there a way around this or do I have to build up a list of what I want sent back?

Another question slightly off topic, but it seems that although jQuery is a great JS library, it doesn't seem to integrate too well with .net.

Has anyone given up with jQuery to perform server side interaction and just gone with ms ajax implementation?

A: 

The reason for this is because asp.net webforms doesn't use a normal post (ie. with an input/submit button). if you take a look at how those are posted, there is some javascript handler that ends up calling a built-in function that asp.net writes out to the page called __doPostBack.

Check out this other stackoverflow answer that might give you additional clues: http://stackoverflow.com/questions/855747/jquery-asp-net-button-click-event-via-ajax/855833#855833

To your second question, once you work out a few of the kinks, jQuery is a fantastic lib that has a ton of support and reference material both on the web and in books. Keep at it and you won't regret it :-)

Joel Martinez
Thanks for the link Joel. Its a shame that one must perform hacky type code in order to get things working. Makes long term support a nightmare :)
Sir Psycho