I have multiple textboxs which are created dynamically in page_load.
TextBox tb = new TextBox();
tb.id = "ID1";
tb.text = GetfromDB();
tb.TextChanged +=new EventHandler(tb_TextChanged);
Now i want to add a javascript confirmbox as
tb.Attributes.Add("onchange","javascript:return confirm('Data has Changed. Click OK To Continue');");
If the user clicks ok then continue to tb_TextChanged function and if user clicks cancel i want to restore the previous value of textbox.
How can i write the javascript function?
Thanks