开发者

c# waiting for a javascript event to finish

开发者 https://www.devze.com 2023-01-04 18:09 出处:网络
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.

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.

thank开发者_开发技巧s in advance, any idea would be helpfull


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

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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消