Getting the current value from a field

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    Getting the current value from a field

    I am having real difficulty trying to get the current value of a field
    on a webform.

    Using fieldname.Text doesn't work?

    Is there something that I need to do to pull through the current value,
    not the existing value.

    Cheers
    Paul

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
  • Ignacio Machin \( .NET/ C#  MVP \)

    #2
    Re: Getting the current value from a field

    Hi,

    show the code of page_load , probably you are rebinding it, or something
    like that.

    cheers,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation



    "Paul" <nospam@nospam. com> wrote in message
    news:eMLwW0O6EH A.4040@TK2MSFTN GP14.phx.gbl...[color=blue]
    >I am having real difficulty trying to get the current value of a field
    > on a webform.
    >
    > Using fieldname.Text doesn't work?
    >
    > Is there something that I need to do to pull through the current value,
    > not the existing value.
    >
    > Cheers
    > Paul
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it![/color]


    Comment

    • Paul

      #3
      Re: Getting the current value from a field

      In the page load

      DataGrid1.EditI temIndex = e.Item.ItemInde x;
      DataGrid1.DataB ind();


      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Ignacio Machin \( .NET/ C#  MVP \)

        #4
        Re: Getting the current value from a field

        that you have to wrap around a
        if ( ! IsPostBack )

        Cheers,

        --
        Ignacio Machin,
        ignacio.machin AT dot.state.fl.us
        Florida Department Of Transportation



        "Paul" <nospam@nospam. com> wrote in message
        news:uqaRWyP6EH A.1292@TK2MSFTN GP10.phx.gbl...[color=blue]
        > In the page load
        >
        > DataGrid1.EditI temIndex = e.Item.ItemInde x;
        > DataGrid1.DataB ind();
        >
        >
        > *** Sent via Developersdex http://www.developersdex.com ***
        > Don't just participate in USENET...get rewarded for it![/color]


        Comment

        • Paul

          #5
          Re: Getting the current value from a field

          Now when I click on the edit button it loads a blank datagrid

          Edit Command code...

          DataGrid1.EditI temIndex = e.Item.ItemInde x;
          DataGrid1.DataB ind();



          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Paul

            #6
            Re: Getting the current value from a field

            The main problem I'm having is when I try and update a datagrid.

            This is the page load code:

            DataGrid1.EditI temIndex = e.Item.ItemInde x;
            DataGrid1.DataB ind();

            and this is what I'm using to get the value out.
            String newValue =((TextBox)e.It em.Cells[1].Controls[0]).Text;

            But this returns the old value?

            Paul

            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            Working...