Problem: Get new value when editting Datagrid

Hi All,

I am trying to gather the new value, when I have finished edditing a particular column in my datagrid, but it still gives me the old value.. Must be that I dont extract the value correctly, because when I trace it the from collections show the new value..
dgList:_ctl2:txtAccount New Value

Here is my code to get the new value in my update event..
Sub dgList_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs)
Dim objAccount As TextBox
Dim sAccount As String
Dim AccID As Integer
AccID = dgList.DataKeys(e.Item.DataSetIndex)
objAccount = CType(e.Item.FindControl("txtAccount"), TextBox)
sAccount = Replace(objAccount.Text, "'", "''")

Response.Write(sAccount) ' STILL SHOWS OLD VALUE


End Sub

Thanks for any help!
0
PleaseTryHelp
9/2/2004 8:35:23 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
490 Views

Similar Articles

[PageSpeed] 22

You need to make sure no databinding occurs on postback - use IsPostback property of the Page to achieve that. That is the most likely reason for you getting the  old value. If you databind on postback the value posted will be replaced by the one from the datasource.

Cheers
Bug [MCSD]
0
Bug_Bugger
9/2/2004 11:50:04 AM
Reply:

Similar Artilces:

Cant get new/edited values from cells when editing a datagrid ...
I'm having some trouble with editing the data in a datagrid.   When i go into edit mode and change to values, they revert to the original ones as soon as the update command is run.  My update command runs a stored proc on a sql server database and i have checked that it is working by giving it fixed strings as the parameters.  It works fine and updates the values as required.   The problem is, when i try to feed in the cell values to the stored proc, it just saves the original values that were in the cells and not the values that i updated.   Why ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

superreview cancelled: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also :
Serge GAUTHERIE <gautheri@noos.fr> has cancelled Jean-Francois Ducarroz <ducarroz@aol.net>'s request for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136206: (Av2) 'mime_generate_headers()' http://bugzilla.mozilla.org/attachment.cgi?id=136206&action=edit ...

Problem getting a Datagrid to allow users to edit it...(in line editing)
Hi, In my DNN custom module I have three panels with various controls on them. If a user clicks the "edit database" button...it makes all these panels disappear and one appear. That panel has a datagrid on it. My goal is to allow users to manipulate the database information using the datagrid. The datagrid is bound to a dataset which is pulled from the database and the data displays fine. I tried adding a button column to the datagrid (I'm using Visual Studio) and it puts a nice "edit" button to the left of every row in the database. Very nice. My understanding ...

Problem How to get a Control Id When i am adding a new control to my webpage
Hi All, I am doing a new web site in Asp.2.0, here i am using masterpages,webparts, and WebUserControls. what my problem is i did some webuser controls like Announcements, Categories, Links, Like that. so now i am adding these controls in my webparts where ever i need. so the problem is a single control i am using 2 to 3 times in a page. so at that time i need a id for that control. I know when i am adding a control then it has an id. so how to know that id. please help me in this regard.Regards,Ram Mohan Rao Adduri,Techinical Associate,eSymbiosisHyderabad.Mobile: 9490118545...

superreview requested: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also : #6
Serge GAUTHERIE <gautheri@noos.fr> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136181: (Cv1) <MsgComposeCommands.js> http://bugzilla.mozilla.org/attachment.cgi?id=136181&action=edit ------- Additional Comments from Serge GAUTHERIE <gautheri@noos.fr> 'appr...

superreview cancelled: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; a #3
Serge GAUTHERIE <gautheri@noos.fr> has cancelled Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; and code cleanup. https://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 150073: (Av2f) 'mime_generate_headers()' https://bugzilla.mozilla.org/attachment.cgi?id=150073&action=edit ...

superreview requested: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also : #5
Serge GAUTHERIE <gautheri@noos.fr> has asked Scott MacGregor <mscott@mozilla.org> for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136207: (Dv1) <MailNewsTypes.h> http://bugzilla.mozilla.org/attachment.cgi?id=136207&action=edit ------- Additional Comments from Serge GAUTHERIE <gautheri@noos.fr> 'approval1....

superreview granted: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also : #2
David Bienvenu <bienvenu@nventure.com> has granted neil@parkwaycc.co.uk <neil.parkwaycc.co.uk@myrealbox.com>'s request for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136178: <FilterEditor.dtd> patch v1 http://bugzilla.mozilla.org/attachment.cgi?id=136178&action=edit ...

superreview granted: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also : #5
Seth Spitzer <sspitzer@mozilla.org> has granted Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136181: (Cv1) <MsgComposeCommands.js> http://bugzilla.mozilla.org/attachment.cgi?id=136181&action=edit ------- Additional Comments from Seth Spitzer <sspitzer@mozilla.org&...

superreview requested: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also : #8
Serge GAUTHERIE <gautheri@noos.fr> has asked Seth Spitzer <sspitzer@mozilla.org> for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 136181: (Cv1) <MsgComposeCommands.js> http://bugzilla.mozilla.org/attachment.cgi?id=136181&action=edit ...

superreview requested: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; a #2
Serge GAUTHERIE <gautheri@noos.fr> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; and code cleanup. http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 150073: (Av2f) 'mime_generate_headers()' http://bugzilla.mozilla.org/attachment.cgi?id=150073&action=edit ------- Additional Comments from Serge GAUTHERIE <gautheri@...

superreview requested: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; a #3
Serge GAUTHERIE <gautheri@noos.fr> has asked David Bienvenu <bienvenu@nventure.com> for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; and code cleanup. http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 150091: (Ev1) 'Options > Priority > ...' menu http://bugzilla.mozilla.org/attachment.cgi?id=150091&action=edit ------- Additional Comments from Serge GAUTHERIE &l...

superreview cancelled: [Bug 146075] 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; a #2
Serge GAUTHERIE <gautheri@noos.fr> has cancelled Serge GAUTHERIE <gautheri@noos.fr>'s request for superreview: Bug 146075: 'Message > Edit Message As New' (== 'Edit As New...') set an incorrect initial "X-Priority:" value (when present), which messes up 'Options > Priority' U.I. also; and code cleanup. http://bugzilla.mozilla.org/show_bug.cgi?id=146075 Attachment 150091: (Ev1) 'Options > Priority > ...' menu http://bugzilla.mozilla.org/attachment.cgi?id=150091&action=edit ...

Web resources about - Problem: Get new value when editting Datagrid - asp.net.presentation-controls

Resources last updated: 2/12/2016 1:48:23 PM