Updating text boxes

Posted on 2006-06-06
Last Modified: 2010-04-23
I am working on a web-based ticket application.  I have a view where a user can see help tickets he or she created.  They can click on the ticket, and a new page loads with the text of the ticket so that they can edit the information.  I have an update button that executes an update SQL statement to update the ticket information.  The update query works just fine.  The query takes an input parameter '@Description'.  This parameter is bound to the text box, 'txtDescription.text'.  However, when the update button is selected, and the parameters are being set, the 'txtDescription.text' value is set to the old value, not the actual values that are in the text box.  Does that make sense??? How do I fix it!?  Thanks.
Question by:christopher_perry
    LVL 19

    Accepted Solution

    >> and a new page loads with the text of the ticket so that they can edit the information
    I think what would have been happening is that the text you are assigning to the TextBox when it loads for the first time would be again set to the text box even after the user modifies it and says Update.

    Check your Page_Load code, how have you set the text box text for the first time ?
    use IsPostBack

    If Not IsPostBack Then
       TextBox1.Text="First Time Page is Shown" 'i.e the code to set textxbox value for firts time should be within this IF block
    End if

    LVL 6

    Expert Comment

    Use the AcceptChanges() Method of the DataSet /Adapter
    (the changes will be reflected)


    Author Comment

    Arif- you're right, I had the text boxes populating during Page_Load.  Thanks for the help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    It’s quite interesting for me as I worked with Excel using for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now