TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abdalla Elawad
NA
1k
216.6k
Script working as Keypress, Event in asp.net stop
Oct 4 2016 4:35 AM
how to use Keypress,KeyUp,KeyDown Event in asp.net
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>
what is solution >>> ?
please help me
Reply
Answers (
1
)
Close application when frmLogin Cancel button is pressed
Check dublicate from inSQL while inserting Data from UI C#