Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9044691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:02:59+00:00 2026-06-16T11:02:59+00:00

I am using Visual Studio 2012 and I want it to generate a simple

  • 0

I am using Visual Studio 2012 and I want it to generate a simple onclick JavaScript event for an HTML button. I select the button in the Designer, go to properties, but there is no lightning bolt button for events. How to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:03:00+00:00Added an answer on June 16, 2026 at 11:03 am

    The event doesn’t exist because the HtmlButton Class is just a wrapper so the render can create a HTML output.

    The base ASP.NET equivalent (with events) would be a System.Web.UI.WebControls.Button.

    Now, all System.Web.UI.HtmlControls accept the AddAttribute method, which would allow you to programatically specify the control’s behavior. For example, let’s say you have this code on your HTML page:

    <input type='Button' ID='btn1'>
    

    And you want to add a javascript event. First, make it accessible by the server-side code:

    <input type='Button' ID='btn1' runat='server'>
    

    Then, on the codebehind, add the content:

    this.btn1.AddAttribute("onclick", "doSomething();");
    

    There you go. Hope it works for you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever
I'm using Visual Studio 2012 for Windows Phone 7 and this is my first
I am using Visual Studio Express 2012 RC. If a create a blank hello
I'm using SOAP through Visual Studio 2012 RC with C# to use the Magento
I am using Visual studio 2011 beta with the april 2012 update installed .I
I am currently developing on Visual Studio 2012 RC using TFS Preview for source
Using Visual Studio 2005, I wrote a simple DLL in C that uses the
Using Visual Studio 2012, I'd like to create a C++ project folder called Include
I am using Visual Studio 2010 and I installed Microsoft Report Viewer 2012 Runtime
My team has recently converted to Visual Studio 2012 and is using the Code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.