tags:

views:

31

answers:

2

hi everybody

what i like to do is this: in a button object in asp.net c# I want to read some hidden fields filled by javascript with client browsers data. the function in js if fire when the client push the button but sometimes when in c# I'm reading the hidden fields the js hasn't finish yet so I get the hidden blank. what I need to do is somehow start reading in c# when the js function is done.

thanks in advance, any idea would be helpfull

A: 

Use a callback function from client to server, signaling the server, that the client is done updating. After that, the server can read the values.

Femaref
If the client is done updating he could send the updated values instead of signaling no?. I didn't know asp was capable of reading stuff from clientside apart from something that was send by the client itself
Redlab
+2  A: 

Just prevent the button postback from occurring until the javascript is finished.

This is a simple separation of client-side vs. server-side processing.

John Weldon
the button has this propertys OnClientClick="show11();" runat="server" onclick="ImgBtnLogin_Click" what I want to do is execute the javascript function show11() that is supose to write the value I want to get in the hidden field and after that send all the form to the server and read that hidden field with the c# code of the function ImgBtnLogin_Click but what's happening sometimes is that the page is posted back before the function show11 is done so the hiddenfield goes in blank to the server
Ernesto