---
title: "how to automatically click a html button when asp.net button is clicked"  
description: "how to automatically click a html button when asp.net button is clicked"  
author: "Manoj Bhatt"  
published: 2014-12-01  
updated: 2014-12-02  
canonical: https://www.mindstick.com/forum/12729/how-to-automatically-click-a-html-button-when-asp-dot-net-button-is-clicked  
category: "asp.net"  
tags: ["c#", "html5"]  
reading_time: 1 minute  

---

# how to automatically click a html button when asp.net button is clicked

how to automatically [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) a [html](https://www.mindstick.com/articles/1530/design-a-simple-stylish-calculator-using-html-css-and-javascript) button when [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) button is clicked. I want when I click btn then automatically Button1 which is a html [button is clicked](https://www.mindstick.com/forum/157821/write-a-jquery-code-that-selects-all-the-checkboxes-in-a-form-when-a-select-all-button-is-clicked) and performs the task... that means by pressing one button it internally works for two buttons

## Replies

### Reply by Anonymous User

Attach the onclick event in the markup of the ASPX page (on the [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net)):

onclick="#('elementName').click();"

Now, if you don't want the post back to occur on the ASP.NET button, then do this:

onclick="#('elementName').click(); return false;"


---

Original Source: https://www.mindstick.com/forum/12729/how-to-automatically-click-a-html-button-when-asp-dot-net-button-is-clicked

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
