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 ShanuPosted Apr 6, 2015, 5:00 AM
ahmed saPosted Apr 6, 2015, 4:56 AM
Syed ShanuPosted Apr 6, 2015, 4:29 AM
Gowtham RajamanickamPosted Apr 6, 2015, 4:26 AM
ahmed saPosted Apr 6, 2015, 4:25 AM
Syed ShanuPosted Apr 6, 2015, 4:23 AM
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 saPosted Apr 6, 2015, 4:09 AM
Akhil GargPosted Apr 6, 2015, 3:48 AM
Pranay RanaPosted Apr 6, 2015, 2:41 AM
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
Ranjit PowarPosted Apr 6, 2015, 2:15 AM
Syed ShanuPosted Apr 6, 2015, 1:50 AM