Currently, I am in the process of creating a webpage that involves forms for editing fields within a database. Initially, I was utilizing FormView controls for this purpose, but due to several reasons, I have switched to using DetailsView controls instead. The use of DetailsView controls has significantly sped up the coding process and has resulted in cleaner code as well. With DetailsView, all I need to do is add a BoundField for each field I want to display, eliminating the need for textboxes, labels, etc.
One setback I encountered with DetailsView controls is that I am unable to add the onchange property to a BoundField like I could with textboxes in FormViews. Even programmatically adding it through code behind in the DataBound event did not yield the desired result, as expected.
Does anyone have any suggestions on how to replicate the functionality of textboxes in FormViews, where a JavaScript function is called when the text in a BoundField is changed? My preference is to continue using DetailsViews and BoundFields if possible. If there is a way to achieve this in code-behind by iterating through the fields to add functionality, it would greatly streamline the process, requiring just a few lines of code for each DetailsView, as opposed to declaratively adding it for every BoundField (of which there are many).