Detailsview

Discussion in 'ASP .Net Web Controls' started by McGivney@noSpam.com, Aug 13, 2007.

  1. Guest

    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
    }
     
    , Aug 13, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Murugan V via DotNetMonster.com

    How to add the DropDownList and TextBox Control in DetailsView

    Murugan V via DotNetMonster.com, Jan 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    664
    Murugan V via DotNetMonster.com
    Jan 8, 2005
  2. =?Utf-8?B?Q2VyaV9EYXZpZXM=?=

    Binding a textbox to a detailsview in asp.net 2.0

    =?Utf-8?B?Q2VyaV9EYXZpZXM=?=, Mar 22, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    989
    =?Utf-8?B?Q2VyaV9EYXZpZXM=?=
    Mar 22, 2005
  3. podong28
    Replies:
    1
    Views:
    1,843
    Brock Allen
    Apr 20, 2005
  4. Justin Rich

    Detailsview empty dataset insert

    Justin Rich, May 19, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    3,253
    Justin Rich
    May 19, 2005
  5. Feege
    Replies:
    0
    Views:
    468
    Feege
    Dec 20, 2005
Loading...

Share This Page