473,785 Members | 3,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ItemUpdating using DataSource(Form View or DetailsView)


I've been trying to figure out how the client of a DetailsView or
FormView should handle the ItemUpdating event when setting the datasource
programatically . I want to do something simple like this:

formView.DataSo urce = new SomeUserObject[] { user };
formView.DataBi nd();

All the examples i've come across show a declerative data source being
used. Do i need to use ObjectDataSourc e? I can get the information going
through the cells by parsing the html but that smells funny.

the FormViewUpdateE ventArgs always has the OldValues and NewValues
collection empty.(Keys is too). ModeChanging behaves differently when setting
the data source explicitly(docu mented in the docs) but i can't find anything
for the ItemUpdating event.

I can't seem to get the edited values. I feel i'm missing something simple
but i'm just not sure what! Maybe somehow i need to populate the NewValues
and OldValues myself?
May 22 '06 #1
1 2768
Hi,

Thank you for posting!

Yes, you need to use ObjectDataSourc e here to take full advantage of
ASP.NET 2.0's powerful Data Binding features.

You can learn more information about DataSource controls from following
articles:

#DataSource Controls and Declarative Programming
http://www.nikhilk.net/DataSourceControlThoughts.aspx

#Data Points: Data Source Controls in ASP.NET 2.0
http://msdn.microsoft.com/msdnmag/is...01/DataPoints/
Regards,
Walter Wang
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 23 '06 #2

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

Similar topics

0
2804
by: swethasivaram | last post by:
Hi all I am displaying some information from my database using DetailsView which is bound to SqlDataSource1. <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataSourceID="SqlDataSource1" ForeColor="#333333" > <asp:SqlDataSource ID="SqlDataSource1" runat="server"
1
1186
by: Nate Hekman | last post by:
I've got an AccessDataSource configured to return a single record. I've bound that to a FormView. Beautiful, right out of the box I get a simple tabular display of all the fields in that record. But now I want to make that output look nicer, and I'm running into trouble. The record I'm displaying is a Knowledge Base article, and it has fields such as Symptoms, Cause, and Resolution. I need to display a title, "Symptoms", followed by...
1
2102
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item view, the text runs together. All the line breaks are missing. When I enter into Edit mode, the text is formatted as it was entered (line breaks). How can I fix this so that when in "Item" mode, the line breaks show?
0
1687
by: le0 | last post by:
Guys, I create a simple insertion in a database using DetailsView control, when i run this page and try to insert some data, the browser returns an error like this --------------------------------------------------------------------------------------------------------------- Server Error in '/Document' Application.
0
1014
by: Nathan Sokalski | last post by:
I am using a FormView control, and want to access the controls I have created in the PagerTemplate. Right now, I am doing this using the following method: CType(Me.FormViewID.FindControl("PagerTemplateControlID"), LinkButton) However, this gives me the following error:
0
1130
by: Nathan Sokalski | last post by:
I have a very simple FormView control, but when I view the page it does not show the Paging controls, although it does show the data. Here is my code: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="FormViewTest.aspx.vb" Inherits="family.FormViewTest" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head...
1
1809
by: renatois | last post by:
DeleteCommand in SqlDataSource using DetailsView Hi guys, Figure that: - I have two related tables by IDName: 1 - table Name (fields: IDName, Name) 2 - table Products (fields: IDProduct, IDName, Product) On the page I have a DetailsView for inserting data on table Name and a GridView for editing and deleting records. In table Name, deleting and editing are ok but if I have a reference of IDName in table Product the deleting send me an...
0
3550
by: =?iso-8859-2?Q?=A3ukasz_Led=F3chowski?= | last post by:
Hi! I am using FormView with SqlDataSource. The problem is that during ItemUpdating event of FormView, NewValues table is empty. OldValues has all values of fields bound on template. What can be the reason? -- Łukasz Ledóchowski GG: 503647 lukled@tlen.pl
6
2279
by: IReallyNeedHelp | last post by:
I have saved the questions using AddQuestion.aspx page i have created but i don't know how to display it and calculate their score. this is the formview i have done, but there is some error <asp:FormView ID="FormView1" runat="server" DataKeyNames="QuestionID" DataSourceID="SqlDataSource1" Width="151px" AllowPaging="True"> <EditItemTemplate> QuestionID: ...
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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
10319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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...
0
8971
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...
0
5380
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...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4046
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
3645
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.