473,398 Members | 2,380 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,398 software developers and data experts.

ObjectDataSource update using callback instead of postback

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
Nov 19 '05 #1
4 3371
Hi Jim,

We have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Nov 19 '05 #2
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=?=" <Ji**************@nospam.nospam>
| Subject: ObjectDataSource update using callback instead of postback
| Date: Fri, 11 Nov 2005 16:16:01 -0800
| Lines: 24
| Message-ID: <6E**********************************@microsoft.co m>
| 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
|

Nov 19 '05 #3
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=?=" <Ji**************@nospam.nospam>
| Subject: ObjectDataSource update using callback instead of postback
| Date: Fri, 11 Nov 2005 16:16:01 -0800
| Lines: 24
| Message-ID: <6E**********************************@microsoft.co m>
| 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
|

Nov 19 '05 #4
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=?=" <Ji**************@nospam.nospam>
| References: <6E**********************************@microsoft.co m>
<hf**************@TK2MSFTNGXA02.phx.gbl>
| Subject: RE: ObjectDataSource update using callback instead of postback
| Date: Mon, 14 Nov 2005 09:01:04 -0800
| Lines: 96
| Message-ID: <14**********************************@microsoft.co m>
| 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=?=" <Ji**************@nospam.nospam>
| > | Subject: ObjectDataSource update using callback instead of postback
| > | Date: Fri, 11 Nov 2005 16:16:01 -0800
| > | Lines: 24
| > | Message-ID: <6E**********************************@microsoft.co m>
| > | 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
| > |
| >
| >
|

Nov 19 '05 #5

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

Similar topics

0
by: msnews.microsoft.com | last post by:
I've got a paging and sorting enabled GridView whose datasource is and AccessDataSource. I build the SelectCommand at PageLoad - it's a union query to show items and comments of the user logged...
12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
4
by: Anne Catterick | last post by:
Hi, I have an british ASP.Net 2.0 application which is doing what (should) be very simple. But I am having issues. On my page I have a GridView as follows (some tags excluded for easy...
3
by: mthomason | last post by:
I keep getting this error when trying to update records using an ObjectDataSource. I have seen others post similar errors...but I haven't found any solutions. ObjectDataSource...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
0
by: Angel | last post by:
I created a Dataset Type on one project which generates a DLL. I have a web project . I created a webpage with a gridview. I attached an ObjectDatasource to the Dataset type from my other project....
3
by: KaOne | last post by:
Hi All, excuse me in advance for my not very perfect english. I need some help about a problem with a FormView bounded to an ObjectDataSource. In practise I have an ObjectDataSource that uses some...
4
by: tim.cavins | last post by:
I have a GridView populated by an ObjectDataSource. I am having issues passing the parameters to the objectdatasource. I have verified that the method is being called but none of the parameters...
1
by: John Kotuby | last post by:
Hi guys, I have finally added the AJAX extensions to my ASP.NET project in VS 2005 and VB. It was far simpler than I had anticipated, and I wondering why I didn't use the Update Panel sooner. ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.