Note that there are some explanatory texts on larger screens.

plurals
  1. USwelegan
    primarykey
    data
    text
    plurals
    1. COGenerally, ASP.NET has access to the previous value of a control before a postback via the ViewState property (although this depends on each control's implementation). You can set the `EnableViewState` to `false` property on the text box to see if this is what is causing your issue, but it would be extemely weird if it was.
      singulars
    2. COI see, I wasn't aware that you needed elements in your dynamic HTML from the database to get mapped back into properties in your page. That's a much tougher proposition, which would require you reveal some more things like are there common property names between these radio buttons and other controls? It's not possible to automatically assign dynamically named input elements into page variables, you'd have to use the `Page.Forms` collection and assign them manually on postback. My answer was for the case where you wanted to record changes to the HTML of the field from the database only.
      singulars
    3. COThe code does not add onKeyUp event to the controls from the database, it adds it to the `TextBox` control that is used to display the text from the database. The purpose of the `onKeyUp` is to take the text from the database (which is in the input element to maintain state with Postback) and copy it into a div element right below it as html. This will cause the "yourPreview" div to show it as it would actually display in HTML.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload