Detailsview

M

McGivney

I want to place a value from a databound cell in a detailsview into a label.
The code below works on page load, but then on subsequent record changes it
returns the value of the cell before the detailsview changed. Old value, I
need value after the change.

What am I overlooking ?

Thanks in advance for your help,

Jim
(Originally posted to vsnet.general)



protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DetailsViewRow row;
row = DetailsView1.Rows[0];
Label1.Text = row.Cells[1].Text;
//This works on page load
}
}



protected void DetailsView1_PageIndexChanged(object sender, EventArgs e)
{
DetailsViewRow row;
row = DetailsView1.Rows[0];
Label1.Text = row.Cells[1].Text;
// This gives value for old record before detailsview changed
}
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top