in last time i get a solution from here site for keypress events as script but now is stop
<script>
function getdata(e) {
if (e.keyCode == 13) {
SqlCommand cmd = new SqlCommand("Select * from TBL_PRD WHERE Barcode=@Barcode", Conn);
cmd.Parameters.Add(new SqlParameter("@BARCODE", TextBox3.Text));
Conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
TextBox3.Text = reader.GetString(1);
TextBox4.Text = reader.GetString(2);
DropDownList3.Text = reader.GetString(3);
//DropDownList2.Text = reader.GetString(4);
}
reader.Close();
Conn.Close();
//TextBox1.Text = "";
//TextBox2.Text = "";
}
e.preventDefault();
return false;
}
else if (e.keyCode == 9) {
SqlCommand cmd = new SqlCommand("Select * from TBL_PRD WHERE Barcode=@Barcode", Conn);
cmd.Parameters.Add(new SqlParameter("@BARCODE", TextBox3.Text));
Conn.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
TextBox3.Text = reader.GetString(1);
TextBox4.Text = reader.GetString(2);
DropDownList3.Text = reader.GetString(3);
//DropDownList2.Text = reader.GetString(4);
}
reader.Close();
Conn.Close();
//TextBox1.Text = "";
//TextBox2.Text = "";
}
e.preventDefault();
return false;
}
}
</script>