Results 1 to 8 of 8

Thread: How to change the textbox's text property

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2001
    Location
    Canada
    Posts
    36

    How to change the textbox's text property

    Hi,

    I am new to ASP.net. I am working on a Web application by using C# and ASP.net. In the page_load event, all textboxes are loaded based on the default values. When the page is shown up, users can change the values in the textboxes and click save button on the page to update the default values. My problem is when I change value in box, for example form AB to CD, the value saved still is AB when I click save button. I used breakpoint to debut the code line by line and the text properity of the textbox is the old one(AB). It seems that the old value is remembered in somewhere in the page_load event.

    Please help me.

    Thanks

    James

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    Code:
    // IsPostBack tells you, as the programmer, if the user has hit a server side control with autopostback = true, in your case the button.
    if (!IsPostBack)
    {
        // Your text box initialisation.
    }
    else
    {
        // Your database updates.
    }

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    axion i really dont get that u posted..i am having the same problem when i fill some text boxes with some default text and want the user to put some own text..then i have a submit button that should save the settings but it is saving the old(default) settings..how should i avoid that?
    \m/\m/

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    If you guys post your code, I will show you what axion_sa is saying about the postback.

  5. #5
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    This might be an hail mary, but I think they are using the html submit button and not an asp.net server control.

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    no no
    i am using the asp.net one
    \m/\m/

  7. #7
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Post the code. This should be easy to solve.

  8. #8
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i've wrote in another post but now i am changing a lot of things so i cant replicate that now..but i am having some problems with deletings cookies..could u plz take a look at my other cookie post? http://www.vbforums.com/showthread.p...hreadid=254616
    \m/\m/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width