Live Webinar: Prompt Engineering: Skill Everyone Must Learn Today
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Call Client Click from a Button Click in ASP.NET
WhatsApp
Rohit Airi
Dec 04
2014
7
k
0
2
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
Up Next
How to Call Client Click from a Button Click in ASP.NET