Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Performance : "input runat=server" or "asp:textbox"

Performance : "input runat=server" or "asp:textbox"

Scheduled Pinned Locked Moved ASP.NET
htmlsysadminperformancetutorialquestion
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gnjunge
    wrote on last edited by
    #1

    Hello, Does anybody have a preference of using htmlcontrols over webcontrols? If I don't need all the props of asp:textbox, should I use the html control equivalent? Are there differences in performance? (Idem the difference between for example select runat="server" and asp:dropdownlist) Would like to hear your thoughts. Gidon

    E A A G 4 Replies Last reply
    0
    • G gnjunge

      Hello, Does anybody have a preference of using htmlcontrols over webcontrols? If I don't need all the props of asp:textbox, should I use the html control equivalent? Are there differences in performance? (Idem the difference between for example select runat="server" and asp:dropdownlist) Would like to hear your thoughts. Gidon

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      I tend to use asp.net controls because in the future if I need to make adjustments to them and add features its easier to leave as asp.net controls. To be honest I think the asp.net controls were created to go with the back end code. If you arent using back end code with them, then it might as well use html controls

      1 Reply Last reply
      0
      • G gnjunge

        Hello, Does anybody have a preference of using htmlcontrols over webcontrols? If I don't need all the props of asp:textbox, should I use the html control equivalent? Are there differences in performance? (Idem the difference between for example select runat="server" and asp:dropdownlist) Would like to hear your thoughts. Gidon

        A Offline
        A Offline
        Arindam Tewary
        wrote on last edited by
        #3

        Performancw wise Input with Ruat=server is better. Because asp:textbox webcontrol is converted into input control from server(when it is rendered by browser). This is an extra step done by server if you use asp:textbox. But associating data(we say its databinding) with asp:textbox is much more easier than input type with runat=server for a developer. Apart from that Asp:textbox is having more properties and methods exposed to developer which makes it more useful( makes job is easier for developer ) to developer.

        Thanks, Arindam D Tewary

        N 1 Reply Last reply
        0
        • G gnjunge

          Hello, Does anybody have a preference of using htmlcontrols over webcontrols? If I don't need all the props of asp:textbox, should I use the html control equivalent? Are there differences in performance? (Idem the difference between for example select runat="server" and asp:dropdownlist) Would like to hear your thoughts. Gidon

          A Offline
          A Offline
          Anand Desai
          wrote on last edited by
          #4

          It depends on purpose certainly.. but I use "input/select.. with runat=server" as much as possible because you find difficult to perform Javascript functions like "OnClick" or "OnChange" or "OnKeyUp"... likewise on server controls. It give strange error at that perticular HTML line.. Using "input/select.. with runat=server" solves that smoothly. And as I have to use Javascripts frequently with my coding, i prefer runat=server comments pls.

          Anand Desai Developer Atharva Infotech

          A N 2 Replies Last reply
          0
          • A Anand Desai

            It depends on purpose certainly.. but I use "input/select.. with runat=server" as much as possible because you find difficult to perform Javascript functions like "OnClick" or "OnChange" or "OnKeyUp"... likewise on server controls. It give strange error at that perticular HTML line.. Using "input/select.. with runat=server" solves that smoothly. And as I have to use Javascripts frequently with my coding, i prefer runat=server comments pls.

            Anand Desai Developer Atharva Infotech

            A Offline
            A Offline
            Arindam Tewary
            wrote on last edited by
            #5

            Hi Ananth, First you can never have a OnClick or OnChange in javascript. This are server side event so you can never haandle that using javascript (No way) In javascript what you handle is onclick and onchange event. Please check the case of this (Upper case and lower case which I mean).

            Thanks, Arindam D Tewary

            1 Reply Last reply
            0
            • A Arindam Tewary

              Performancw wise Input with Ruat=server is better. Because asp:textbox webcontrol is converted into input control from server(when it is rendered by browser). This is an extra step done by server if you use asp:textbox. But associating data(we say its databinding) with asp:textbox is much more easier than input type with runat=server for a developer. Apart from that Asp:textbox is having more properties and methods exposed to developer which makes it more useful( makes job is easier for developer ) to developer.

              Thanks, Arindam D Tewary

              N Offline
              N Offline
              N a v a n e e t h
              wrote on last edited by
              #6

              Arindam Tewary wrote:

              Performancw wise Input with Ruat=server is better

              I don't think you will see a huge difference as both needs to processed to render HTML input. ASP.NET engine is quick enough to do this.

              Arindam Tewary wrote:

              asp:textbox webcontrol is converted into input control from server(when it is rendered by browser)

              ASP.NET just converts the asp:textbox to equivalent HTML input control and emits the HTML to response and it is rendered by browser. Browser is not the one who is converting from asp:textbox HTML input.

              Arindam Tewary wrote:

              This is an extra step done by server if you use asp:textbox.

              This step is happening for input element with runat=server attribute.

              All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

              A 1 Reply Last reply
              0
              • A Anand Desai

                It depends on purpose certainly.. but I use "input/select.. with runat=server" as much as possible because you find difficult to perform Javascript functions like "OnClick" or "OnChange" or "OnKeyUp"... likewise on server controls. It give strange error at that perticular HTML line.. Using "input/select.. with runat=server" solves that smoothly. And as I have to use Javascripts frequently with my coding, i prefer runat=server comments pls.

                Anand Desai Developer Atharva Infotech

                N Offline
                N Offline
                N a v a n e e t h
                wrote on last edited by
                #7

                Anand Desai wrote:

                as much as possible because you find difficult to perform Javascript functions like "OnClick" or "OnChange" or "OnKeyUp"... likewise on server controls. It give strange error at that perticular HTML line..

                Then you are not using it in the proper way. Since ASP.NET 2.0, most of the server controls provide "OnClientClick" event which can be used to hook JS methods. You can also use Attributes.Add() to add these type of attributes to the control as well.

                All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                1 Reply Last reply
                0
                • N N a v a n e e t h

                  Arindam Tewary wrote:

                  Performancw wise Input with Ruat=server is better

                  I don't think you will see a huge difference as both needs to processed to render HTML input. ASP.NET engine is quick enough to do this.

                  Arindam Tewary wrote:

                  asp:textbox webcontrol is converted into input control from server(when it is rendered by browser)

                  ASP.NET just converts the asp:textbox to equivalent HTML input control and emits the HTML to response and it is rendered by browser. Browser is not the one who is converting from asp:textbox HTML input.

                  Arindam Tewary wrote:

                  This is an extra step done by server if you use asp:textbox.

                  This step is happening for input element with runat=server attribute.

                  All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                  A Offline
                  A Offline
                  Arindam Tewary
                  wrote on last edited by
                  #8

                  N a v a n e e t h wrote:

                  both needs to processed to render HTML

                  In HTML server control, actually the code written is copied back to browser. But if you have asp web server server control, AS.NET engine emits equivalent HTML output therfore a CONVERSION happens. Yah I agree system quick enough, still you cant ignore the basic difference of HTML and asp web server controls. It was never told that browser does that conversion. It was wriiten that server does that job. Anywaz good post by you. I must appreciate.

                  Thanks, Arindam D Tewary

                  N 1 Reply Last reply
                  0
                  • A Arindam Tewary

                    N a v a n e e t h wrote:

                    both needs to processed to render HTML

                    In HTML server control, actually the code written is copied back to browser. But if you have asp web server server control, AS.NET engine emits equivalent HTML output therfore a CONVERSION happens. Yah I agree system quick enough, still you cant ignore the basic difference of HTML and asp web server controls. It was never told that browser does that conversion. It was wriiten that server does that job. Anywaz good post by you. I must appreciate.

                    Thanks, Arindam D Tewary

                    N Offline
                    N Offline
                    N a v a n e e t h
                    wrote on last edited by
                    #9

                    Arindam Tewary wrote:

                    In HTML server control, actually the code written is copied back to browser.

                    Not exactly. It also will go through all the phases like loading/saving viewstate etc.

                    Arindam Tewary wrote:

                    It was never told that browser does that conversion. It was wriiten that server does that job.

                    I know, but something written in the brackets was giving confusion. :)

                    All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                    A 1 Reply Last reply
                    0
                    • N N a v a n e e t h

                      Arindam Tewary wrote:

                      In HTML server control, actually the code written is copied back to browser.

                      Not exactly. It also will go through all the phases like loading/saving viewstate etc.

                      Arindam Tewary wrote:

                      It was never told that browser does that conversion. It was wriiten that server does that job.

                      I know, but something written in the brackets was giving confusion. :)

                      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                      A Offline
                      A Offline
                      Arindam Tewary
                      wrote on last edited by
                      #10

                      You won man !!! :laugh:

                      Thanks, Arindam D Tewary

                      N 1 Reply Last reply
                      0
                      • A Arindam Tewary

                        You won man !!! :laugh:

                        Thanks, Arindam D Tewary

                        N Offline
                        N Offline
                        N a v a n e e t h
                        wrote on last edited by
                        #11

                        Arindam Tewary wrote:

                        You won man

                        :) you are sporty.

                        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

                        1 Reply Last reply
                        0
                        • G gnjunge

                          Hello, Does anybody have a preference of using htmlcontrols over webcontrols? If I don't need all the props of asp:textbox, should I use the html control equivalent? Are there differences in performance? (Idem the difference between for example select runat="server" and asp:dropdownlist) Would like to hear your thoughts. Gidon

                          G Offline
                          G Offline
                          gnjunge
                          wrote on last edited by
                          #12

                          Thank you all for your replies. My general perception from all your replies is that it doesn't really matter for simple textboxes what method one chooses. I wonder though with a dropdownlist, with lets say a 100 entries (static, written inside the markup, so no databinding), would there be a difference in using select runat="server" and asp:dropdownlist runat="server?

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups