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 6663095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:27:42+00:00 2026-05-26T02:27:42+00:00

Firstly could someone please be kind enough to comment on why Microsoft might have

  • 0

Firstly could someone please be kind enough to comment on why Microsoft might have chosen to make the ASP.NET button control render an <input type='button' /> tag rather than a <button /> tag? I have seen a number of issues (particularly when creating jQuery buttons with no text and just icons) as a result of this.

Secondly I am attempting to create my own custom button output by overriding the Render() event and am having a bit of difficulty trying to understand how to go about changing the output that is provided by this event.

If I look at the HtmlTextWriter that is provided as the parameter to the Render() event I can see it contains a protected property TagKey = Input {47}, is it possible to simply modify this property somehow and change it to a Button or do I need to create a new instance of the HtmlTextWriter and populate it all from the start? If so, could anyone provide some guidance as to how this would typically be done and if there are any special considerations I need to make to ensure that my derived button class is functionally equivalent to the original (excluding the html)?

<Assembly: TagPrefix("MyCompany", "MyCustomButton")> 
Public Class MyButton
    Inherits Button

    Protected Overrides Sub OnPreRender(e As System.EventArgs)
        MyBase.OnPreRender(e)
    End Sub

    Protected Overrides Sub Render(writer As System.Web.UI.HtmlTextWriter)
        'writer.TagKey = Input {47}
        MyBase.Render(writer)
    End Sub
End Class
  • 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-05-26T02:27:43+00:00Added an answer on May 26, 2026 at 2:27 am

    No idea on Microsoft’s decision, but for the TagKey, you just need to override the TagKey property and return HtmlTextWriterTag.Button. You will also want to override the AddAttributesToRender method and not call the base method so that it wouldn’t output the type="button" attribute.

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

Sidebar

Related Questions

Could someone please explain why this is happening. I have simplified my problem by
Firstly: I am totally a newbie for this kind of work. I have a
Could someone please give me some advice/ideas about how to deal with the situations
Ok, i'd like to firstly make you notice that i have looked for php
Could you please explain me the logic of UNIX signal system: firstly it sends
Could someone please show how i could parse a ics file using NSScanner? (Iphone
Firstly could someone clarify whether in C++ the use of the [] operator in
Firstly, the title was the best I could come up with. I have written
Firstly, let me set out what I'd like to do. Assume I have three
Firstly, I was wondering if there was some kind of built in function that

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.