Update from HiddenField rather than TextBox

Last post 10-31-2008 1:58 PM by jwize. 2 replies.

Sort Posts:

  • Update from HiddenField rather than TextBox

    10-27-2008, 3:41 PM
    • Member
      143 point Member
    • jwize
    • Member since 10-12-2005, 9:42 PM
    • Posts 123

    I have an textbox that is populated by my html editor the display is a lable so that the users can only do the updates through the html editor(I don't want them to mess up the code.). The code also has a hidden field that is responsible for binding of the data. Updates seem to be ignoring the information saved in the bound control.

    There are the fields in the edit template in the custom control.

    <asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Bind("Bio") %>' />

    <br />

    <asp:Label ID="lblBio" runat="server" Width="515px" Text='<%# TruncateText(Eval("Bio")) %>' />

    <br />

  • Re: Update from HiddenField rather than TextBox

    10-31-2008, 3:31 AM
    Answer

    Hi,

    Do you change the value of the <input type="hidden"> at client side (the <input> tag is rendered by the HiddenField control)? If so I think it should work.

    Sincerely,
    Allen Chen
    Microsoft Online Community Support

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Update from HiddenField rather than TextBox

    10-31-2008, 1:58 PM
    Answer
    • Member
      143 point Member
    • jwize
    • Member since 10-12-2005, 9:42 PM
    • Posts 123

    Yes, and I solved it. I had the need to manually update the information in the oninserting event of the datasource. I also realized that I had hardcoded the value "Bio" in the field so it was a matter of changing the Bind statment to an Eval(this.Column.name) statement to make it a more generic solution, but that is another story.

Page 1 of 1 (3 items)