c# - Text change in TextBoxes -


i have 32 textboxes , 1 "save" button. want save text textboxes have texts changed. how can achieve that? how know text of textboxes have changed?

personally, server-side. assuming have no data binding involved, following in aspx.cs code-behind:

...  private string initialvalue1  {      { return viewstate[@"iv1"] string; }      set { viewstate[@"iv1"] = value; } } // repeat 32 text boxes.  protected void page_load( object sender, eventargs e ) {     if(!ispostback )     {         textbox1.text = initialvalue1 = loadtext1fromdatabase();         // repeat 32 text boxes.     } }  protected void mysavebutton_click( object sender, eventargs e ) {     if ( textbox1.text!=initialvalue1 ) savetext1todatabase( textbox1.text );     // repeat 32 text boxes. }  ... 

of course, in real-world-scenario, looping/array handling instead of writing 32 same functions/properties.


Comments