RE: Textbox postback putting value,value

Discussion in 'ASP .Net' started by =?Utf-8?B?QW5hY2hvc3RpYw==?=, Jun 18, 2004.

  1. This means you have two fields in the HTML form with the same name. When your page loads, View Source and look for multiple instances of a field with the same name, especially <input type=hidden>.

    Viewstate would not act like that. It would only happen if you were manually manipulating the values. In your code behind page, are you doing anything like Myfield.text=request.form("MyField")?


    "Keith Doran" wrote:

    > I have a webform page that contains a textbox control. The textbox is
    > initialized by the codebehind module and contains a value when the page
    > is first
    > loaded. The user can then edit the textbox if they choose to or leave
    > it as is.
    >
    > The strange behavior I'm seeing is that when the form is posted back to
    > the
    > server, the textbox's text property contains the new value followed by a
    > comma
    > and then the original value. eg. if the control was initialized to
    > contain "Joe"
    > and the user deletes that value and enters "Stan" the textbox1.text
    > property
    > contains "Stan,Joe" immediately after the postback. The MaintainState
    > property
    > has no effect on this behavoir. If the user didn't touch the textbox
    > it would
    > contain "Joe,Joe" Even textboxes that were originally blank contain a
    > comma when
    > posted back.
    >
    >
    > Any help please??
    >
    =?Utf-8?B?QW5hY2hvc3RpYw==?=, Jun 18, 2004
    #1
    1. Advertising

  2. Have looked at my form and cannot see any fields with the same name.
    The only thing that I am doing in the code behind is -
    when a link is clicked in a datagrid - a panel is made visible and a the form fields are filled, in a standard manner from a database.
    textbox1.Text = dbvalue.

    The hidden input fields are standard
    <input type="hidden" name="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" value="dDwxMDk1....." />


    "Anachostic" wrote:

    > This means you have two fields in the HTML form with the same name. When your page loads, View Source and look for multiple instances of a field with the same name, especially <input type=hidden>.
    >
    > Viewstate would not act like that. It would only happen if you were manually manipulating the values. In your code behind page, are you doing anything like Myfield.text=request.form("MyField")?
    >
    >
    > "Keith Doran" wrote:
    >
    > > I have a webform page that contains a textbox control. The textbox is
    > > initialized by the codebehind module and contains a value when the page
    > > is first
    > > loaded. The user can then edit the textbox if they choose to or leave
    > > it as is.
    > >
    > > The strange behavior I'm seeing is that when the form is posted back to
    > > the
    > > server, the textbox's text property contains the new value followed by a
    > > comma
    > > and then the original value. eg. if the control was initialized to
    > > contain "Joe"
    > > and the user deletes that value and enters "Stan" the textbox1.text
    > > property
    > > contains "Stan,Joe" immediately after the postback. The MaintainState
    > > property
    > > has no effect on this behavoir. If the user didn't touch the textbox
    > > it would
    > > contain "Joe,Joe" Even textboxes that were originally blank contain a
    > > comma when
    > > posted back.
    > >
    > >
    > > Any help please??
    > >
    =?Utf-8?B?S2VpdGggRG9yYW4=?=, Jun 21, 2004
    #2
    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. Ashish

    textbox value lost upon postback

    Ashish, Feb 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    9,919
    Ashish
    Feb 17, 2004
  2. Ed West
    Replies:
    1
    Views:
    888
    Steve Willcock
    Aug 9, 2004
  3. =?Utf-8?B?UGF0cmljaw==?=

    Putting value in asp:TextBox

    =?Utf-8?B?UGF0cmljaw==?=, Jun 6, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    21,237
  4. Saurabh
    Replies:
    6
    Views:
    4,495
    Chris Smith
    May 30, 2004
  5. Replies:
    2
    Views:
    325
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
Loading...

Share This Page