RE: ObjectDataSource update using callback instead of postback



Hi Jim,

As for ASP.NET script callback, its request (call back to serversdie...) is
different from our normal post back request. For performance consideration,
some of the normal processing in the server request have been bypassed in
scrpit call back. Such as the Control Tree constructing and populating and
some normal postback data processing and events other than the script call
back. So we don't recommend that our serverside script call back function
will have any code logic which rely on the page's control model. Is you'd
like to do data updating, it is recommended, that we use Sqlconnection and
SqlComand and executing the command separately and return the executing
result to clientside whicn will be better.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| Thread-Topic: ObjectDataSource update using callback instead of postback
| thread-index: AcXnHkNwxKAJxANARKu4/LaAlXQNYA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <JimHammond363897@xxxxxxxxxxxxx>
| Subject: ObjectDataSource update using callback instead of postback
| Date: Fri, 11 Nov 2005 16:16:01 -0800
| Lines: 24
| Message-ID: <6E16CED6-F51A-46D8-A552-2739D9C5E027@xxxxxxxxxxxxx>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:357527
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| It would be udeful to be able to get the current on-screen values from a
| FormView that is databound to an ObjectDataSource by using a callback
instead
| of a postback. For example:
|
| public void RaiseCallbackEvent(string eventArgs)
| {
| // update the data object with the values currently on screen
| FormView1.UpdateItem(true);
| }
|
| In an ordinary postback, such as a button click handler, calling
UpdateItem
| would force a call to the following business class update method, and the
obj
| parameter would contain the values currently on screen:
|
| public static void Update(MyBusinessClass obj)
| {
| // validate, store, etc. here
| }
|
| However, if I call UpdateItem in RaiseCallbackEvent, then the obj
parameter
| in the business class update method will not have been updated with the
| values the user has just typed in the form.
|
| Jim
|

.