0

I'm having some problems with the server side and client events on my web form. What I found is that client side events fire before server events. This is problematic for me because I have a jquery function that clears the form when it's submitted but the form is cleared before my server side event has fired so I wind up with a blank record in my database.

How can I get around this problme?

The other question I have is whether there are any good resources or books that go in depth on the interaction between ASP.NET and client side scripting that would cover issues such as what I'm experiencing?

Thanks

2
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by obb-taurus
0

Client side actions happen first because they occur in the browser and don't require the post back. Why don't you simply remove the part of the script that clears the form?

0

Removing the script would solve my problem but I need to clear out the form after the data is submitted. I realize the form can be cleared using server side code but I though the whole purpose behind client side code is to avoid a round trip to the server, unless I'm horribly mistaken about that I would prefer to clear the form from the client side.

Thanks

0

But you are doing server side processing, thats the problem you are having. So you won't be triggering a round trip just to clear the form because you can just add that to whatever else you are doing server side. No extra trip required.

0

Hadn't really though of it that way but makes perfect sense.

Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.