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
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
How to Call Client Click from a Button Click in ASP.NET
Rohit Airi
Dec 04
2014
Code
6.3
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
This is very important technique to call a JavaScript from a button click. Sometimes we have to use it when (as you in ASP.NET programming, there are two click event one is JScript click and another is onClick event which will code behind.).
So here, I am explaining, How you can call a JavaScript function from a button click.
<html>
<head>
</head>
<script type=
"text/javascript"
>
function
btnClick() {
alert(
"btn clicked"
);
}
</script>
<body>
<asp:Button ID=
"btnClick"
runat=
"server"
Text=
"ClickMe"
OnClientClick=
"btnClick()"
></asp:Button>
</body>
</html>
ASP.NET
Call Client Click button
JavaScript