473,725 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ObjectDataSourc e 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 ObjectDataSourc e by using a callback instead
of a postback. For example:

public void RaiseCallbackEv ent(string eventArgs)
{
// update the data object with the values currently on screen
FormView1.Updat eItem(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(MyBusine ssClass obj)
{
// validate, store, etc. here
}

However, if I call UpdateItem in RaiseCallbackEv ent, 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 3410
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: ObjectDataSourc e update using callback instead of postback
| thread-index: AcXnHkNwxKAJxAN ARKu4/LaAlXQNYA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1 vbmQ=?=" <Ji************ **@nospam.nospa m>
| Subject: ObjectDataSourc e update using callback instead of postback
| Date: Fri, 11 Nov 2005 16:16:01 -0800
| Lines: 24
| Message-ID: <6E************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3575 27
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| It would be udeful to be able to get the current on-screen values from a
| FormView that is databound to an ObjectDataSourc e by using a callback
instead
| of a postback. For example:
|
| public void RaiseCallbackEv ent(string eventArgs)
| {
| // update the data object with the values currently on screen
| FormView1.Updat eItem(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(MyBusine ssClass obj)
| {
| // validate, store, etc. here
| }
|
| However, if I call UpdateItem in RaiseCallbackEv ent, 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: ObjectDataSourc e update using callback instead of postback
| thread-index: AcXnHkNwxKAJxAN ARKu4/LaAlXQNYA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1 vbmQ=?=" <Ji************ **@nospam.nospa m>
| Subject: ObjectDataSourc e update using callback instead of postback
| Date: Fri, 11 Nov 2005 16:16:01 -0800
| Lines: 24
| Message-ID: <6E************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3575 27
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| It would be udeful to be able to get the current on-screen values from a
| FormView that is databound to an ObjectDataSourc e by using a callback
instead
| of a postback. For example:
|
| public void RaiseCallbackEv ent(string eventArgs)
| {
| // update the data object with the values currently on screen
| FormView1.Updat eItem(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(MyBusine ssClass obj)
| {
| // validate, store, etc. here
| }
|
| However, if I call UpdateItem in RaiseCallbackEv ent, 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: ObjectDataSourc e update using callback instead of postback
| thread-index: AcXpPP/FQwZX2qfPRHqo/AByqVztqA==
| X-WBNR-Posting-Host: 209.137.235.2
| From: "=?Utf-8?B?SmltIEhhbW1 vbmQ=?=" <Ji************ **@nospam.nospa m>
| References: <6E************ *************** *******@microso ft.com>
<hf************ **@TK2MSFTNGXA0 2.phx.gbl>
| Subject: RE: ObjectDataSourc e update using callback instead of postback
| Date: Mon, 14 Nov 2005 09:01:04 -0800
| Lines: 96
| Message-ID: <14************ *************** *******@microso ft.com>
| 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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3579 96
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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: ObjectDataSourc e update using callback instead of
postback
| > | thread-index: AcXnHkNwxKAJxAN ARKu4/LaAlXQNYA==
| > | X-WBNR-Posting-Host: 209.137.235.2
| > | From: "=?Utf-8?B?SmltIEhhbW1 vbmQ=?=" <Ji************ **@nospam.nospa m>
| > | Subject: ObjectDataSourc e update using callback instead of postback
| > | Date: Fri, 11 Nov 2005 16:16:01 -0800
| > | Lines: 24
| > | Message-ID: <6E************ *************** *******@microso ft.com>
| > | 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.publi c.dotnet.framew ork.aspnet
| > | NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.p hx.gbl
| > microsoft.publi c.dotnet.framew ork.aspnet:3575 27
| > | X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
| > |
| > | It would be udeful to be able to get the current on-screen values
from a
| > | FormView that is databound to an ObjectDataSourc e by using a callback
| > instead
| > | of a postback. For example:
| > |
| > | public void RaiseCallbackEv ent(string eventArgs)
| > | {
| > | // update the data object with the values currently on screen
| > | FormView1.Updat eItem(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(MyBusine ssClass obj)
| > | {
| > | // validate, store, etc. here
| > | }
| > |
| > | However, if I call UpdateItem in RaiseCallbackEv ent, 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
2901
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 in. This all works fine. I tried to set AccessDataSource.UpdateCommand in the code behind (C#) by handling the GridView.OnUpdating event - since this is supposed to fire before the record is updated, I thought I could set the UpdateCommand here....
12
8697
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 update after making changes, but I don't want that update button. How can I get the updated object when the user presses one of my other action buttons?
4
8503
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 reading): <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" DataKeyNames="Id" OnRowUpdated="GridView1_RowUpdated">
3
1876
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 'ObjectDataSource1' could not find a non-generic method 'UpdateProduct' that has parameters: ProductName, UnitPrice, ProductId. I have been unable to work through this. Any ideas? I’m using code pasted directly from this page:
7
3466
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 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
0
1425
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. I assigned the Insert, Update, and select to the ObjectDataSource. I attached the gridview control to the ObjectDataSource. I run it and edit a record in the grid. When I hit the update, I get the following error: ...
3
8100
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 BLL methods that implements the optimistic concurrency by a TimeStamp field into the DB. So, when I execute an insert, update or delete query if I receive 0 like return value from that queries I understand that a concurrency problem is occurs so...
4
6081
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 are being populated. Integers are being passed as 0 and strings are empty regardless of what I changed them to in Edit mode on the GridView. My object method to perform the update:
1
2137
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. Anyway, one of my pages has many controls and populates large DropDown lists etc. There are only 2 controls on that page using the update panel now
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8099
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3228
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.