Web DataGrid text box doesn't post back (or something else wrong)

P

Paul_FFX

I try to use EditCommandColumn of Datagrid control to update a record.
EditCommand works and Update and Cancel button appear. Then a modify
text in one of appeared text boxes. There is a part of my UpdateCommand
code:

Private Sub DataGrid1_UpdateCommand(ByVal source As Object, _
ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) _
Handles DataGrid1.UpdateCommand
Dim txtKeyID As TextBox = CType(e.Item.Cells(1).Controls(0), TextBox)
Dim txtCube As TextBox = CType(e.Item.Cells(2).Controls(0), TextBox)
Me.Label1.Text = txtCube.Text

Label control is just for troubleshooting. After I click Update button
Label receives old value, not the one that I just typed in. I try to
force Textbox to post back setting AutoPostBack to true as
txtCube.AutoPostBox = true with no result.

Please help.
 
J

John Rivers

--------------------------------------------------
THIS POST IS FURTHER PROOF
--------------------------------------------------

<asp:Unpredictable Rubbish="true"/>

HtmlControls
UserControls
WebControls

are all:

- overcomplicated
- unpredictable
- counter-productive
- inefficient

they cause many more problems than they solve
and it is strongly recommended you avoid them

furthermore it is a farce that ASPX pages do not allow
you to create methods and classes with <%%> script blocks
which are the best way to handle html literals in
presentation logic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top