ICallbackEventHandler

B

Ben Schumacher

I have a page that implements ICallbackEventHandler. I'm trying to
accomplish auto saving a page everytime the user navigates away from the
page. To initialize the callback, I fire the onunload event on the window
as can be seen below.

<script type="text/javascript">

window.onunload = Save;

function Save()
{
CallServer()
}

</script>

This works great as I can see in my Page_Load event that the Page.IsCallBack
property becomes true. Now here is where I am stuck. My RaiseCallBack
event fires just as it should, but when i try to read the ".text" values of
all my textbox controls on the form I get whatever was in the previous
viewstate. Not what i typed/changed the textbox to just before the
callback. Whats even more weird is that when the page comes back to the
client after re-rendering it self i can see my changed text box value. So i
fire the callback again, and still i can't read the current value out of the
textbox control. It's like the ICallBackEventHandler interface doesn't keep
track of the changes on the form. It just gives me whatever that last
viewstate values that were generated from a full page POSTBACK not CALLBACK.

Any suggestions?

Thanks,

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top