Hi guys i have problem i write update statment in textchanged event.but repeated changed when any charachter changed
example
user name text box and has name ahmed and i need to change to ahmedsalah
it save in database as
ahmeds
ahmedsa
ahmedsal
ahmedsala
ahmedsalah
it save 5 times
how please to allow textbox to save after finish typing
I have sql 2005
visual studio 2008
if possible help me

Syed ShanuRank #87 · 23.7K reputationPosted Apr 5, 2015, 9:50 PM EDT
Ranjit PowarRank #553 · 4.4K reputationPosted Apr 5, 2015, 10:15 PM EDT
Pranay RanaRank #735 · 3.2K reputationPosted Apr 5, 2015, 10:41 PM EDT
create serversid method like this , in your aspx.cs file
public void Page_Load
{
if (!Page.IsPostBack)
{
txtId1.Attributes.Add("onblur", "javascript:Callme('" + txtId1.ClientID + "')");
}
}
[WebMethod()]
public static void MyMethod(string param)
{
try { //Do here server event }
catch (Exception) { throw; }
}
than in the aspx page
Akhil GargRank #772 · 3K reputationPosted Apr 5, 2015, 11:48 PM EDT
ahmed saRank #8,218 · 226 reputationPosted Apr 6, 2015, 12:09 AM EDT
Syed ShanuRank #87 · 23.7K reputationPosted Apr 6, 2015, 12:23 AM EDT
then you can use the Textbox Leave Event.
check this sample.The leave event will be trigger only the focus is out of the Textbix control.For example in the text box you can do typing and In Tab Click or other controls click in form the Textbox Leave event will trigger.In that event you can call your save function.
private void textBox1_Leave(object sender, EventArgs e)
{
MessageBox.Show("iam leaving save now");
}
ahmed saRank #8,218 · 226 reputationPosted Apr 6, 2015, 12:25 AM EDT
Gowtham RajamanickamRank #57 · 29K reputationPosted Apr 6, 2015, 12:26 AM EDT
Syed ShanuRank #87 · 23.7K reputationPosted Apr 6, 2015, 12:29 AM EDT
ahmed saRank #8,218 · 226 reputationPosted Apr 6, 2015, 12:56 AM EDT
Syed ShanuRank #87 · 23.7K reputationPosted Apr 6, 2015, 1:00 AM EDT