Hi Jim,
Thanks for your respones. As for ViewState, I'm afraid this is not
updatable from external code. Actually, the script call back event at
serverside just provide an interface for us to make a post back to client
without refreshing the client browser view. However the serverside
processing pipeline has bypass those page/control related constructing ,
viewstate mapping, event mapping. steps. So we can not access those
features in script call back.
And for the below you mentioned:
=====================
Please elaborate on "executing the command separately". Note that the goal
is to get updated data FROM the form rather than sending updated data TO
the
form.
=====================
Yes, what I means is update date through code and then use the result to
modify the FormView's clientside view. I'm afraid we 're not able to
access the FormView or any other controls in script callback (like what we
do in normal postback).
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: AcXpPP/FQwZX2qfPRHqo/AByqVztqA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1vbmQ=?=" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: RE: ObjectDataSource update using callback instead of postback
| Date: Mon, 14 Nov 2005 09:01:04 -0800
| Lines: 96
| Message-ID: <
[email protected]>
| 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:357996
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Is it possible to update the viewstate on the server from the client for
just
| the one formview control - ideally without doing a postback? Is it
possible
| to update the entire viewstate on the server from the client without
doing a
| postback?
|
| Please elaborate on "executing the command separately". Note that the
goal
| is to get updated data FROM the form rather than sending updated data TO
the
| form.
|
| Thanks,
|
| Jim
|
| "Steven Cheng[MSFT]" wrote:
|
| > 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=?=" <
[email protected]>
| > | Subject: ObjectDataSource update using callback instead of postback
| > | Date: Fri, 11 Nov 2005 16:16:01 -0800
| > | Lines: 24
| > | Message-ID: <
[email protected]>
| > | 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
| > |
| >
| >
|