473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ICallBackEventHandler

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
Aug 24 '06 #1
1 1992
New values that the user enters into textboxes are not automatically posted
back via your callback.
Instead you have to explicity grab the values using JavaScript and pass them
back as parameters through your callback.

Here's an example:
http://SteveOrr.net/articles/WebChat.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Ben Schumacher" <bs*********@navegate.comwrote in message
news:eO**************@TK2MSFTNGP04.phx.gbl...
>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

Aug 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike | last post by:
When trying to compile in Visual Web Developer 2005 express beta (framework version )the source code using System; using System.Web.UI; using System.Web.UI.WebControls; using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
2
by: Maya Nasri | last post by:
Hello everyone, I have upgraded to ASP.NET 2 and since then i had the code below stopped working after upgrading and modiftying the code: using System; using System.Data; using...
1
by: JimGreen | last post by:
I recently installed Release Candidate of VS2005 and I am not sure what the hell is the problem but ICallbackEventHandler definition on my machine looks like this: public interface...
0
by: Edwin Knoppert | last post by:
Seems ICallbackEventHandler is meant for the 2.0 beta i guess ??? VWD forces me to public void RaiseCallbackEvent(string eventArgument) And using a public string GetCallbackResult() to return the...
3
by: Harvey Triana | last post by:
Hello I try to implement ICallbackEventHandler follow sample in http://msdn2.microsoft.com/en-us/library/ms178208.aspx I add code line: Implements System.Web.UI.ICallbackEventHandler The...
0
by: Slim | last post by:
I made a page today that uses ICallbackEventHandler. I got to work, but with problems. 1. it is slow, it does not seem any faster than reloading the page. 2. the first time I fire the event it...
1
by: =?Utf-8?B?RGF2aWQgUmVoYWdlbg==?= | last post by:
I currently have a custom control that implements the ICallbackEventHandler interface. Currently it works when the control is added to a standard web form. It does not work however when added to...
1
by: Ian | last post by:
Question: Is there a way to multi-thread ICallbackEventHandler using delegates? Problem: I'm executing client-side calls to my page, which implements ICallbackEventHandler. I need to implement...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.