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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:39:47+00:00 2026-05-10T23:39:47+00:00

Why do I have to specify runat=server on all my ASP.NET controls when it

  • 0

Why do I have to specify runat='server' on all my ASP.NET controls when it is a mandatory attribute and server is the only option available in my limited knowledge of ASP.NET, and I get an error if I don’t use it?

I do understand that I can optionally use it on my HTML tags, and I do understand the client/server paradigm and what it is actually specifying.

Is it a redundant tag that could just be implied by the control being an ASP.NET control, or is there an underlying reason?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T23:39:47+00:00Added an answer on May 10, 2026 at 11:39 pm

    I’ve always believed it was there more for the understanding that you can mix ASP.NET tags and HTML Tags, and HTML Tags have the option of either being runat='server' or not. It doesn’t hurt anything to leave the tag in, and it causes a compiler error to take it out. The more things you imply about web language, the less easy it is for a budding programmer to come in and learn it. That’s as good a reason as any to be verbose about tag attributes.

    This conversation was had on Mike Schinkel’s Blog between himself and Talbot Crowell of Microsoft National Services. The relevant information is below (first paragraph paraphrased due to grammatical errors in source):

    […] but the importance of <runat='server'> is more for consistency and extensibility.

    If the developer has to mark some tags (viz. <asp: />) for the ASP.NET Engine to ignore, then there’s also the potential issue of namespace collisions among tags and future enhancements. By requiring the <runat='server'> attribute, this is negated.

    It continues:

    If <runat=client> was required for all client-side tags, the parser would need to parse all tags and strip out the <runat=client> part.

    He continues:

    Currently, If my guess is correct, the parser simply ignores all text (tags or no tags) unless it is a tag with the runat=server attribute or a “<%” prefix or ssi “<!– #include… (…) Also, since ASP.NET is designed to allow separation of the web designers (foo.aspx) from the web developers (foo.aspx.vb), the web designers can use their own web designer tools to place HTML and client-side JavaScript without having to know about ASP.NET specific tags or attributes.

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

Sidebar

Related Questions

I have a LinqDataSource defined like this: <asp:LinqDataSource ID=LinqDataSource1 runat=server OnSelecting=LinqDataSource_FileSelecting></asp:LinqDataSource> In LinqDataSource_FileSelecting, it
I have an asp.net application in which I am inserting into an sql table
I'm developing a web page in Asp.Net 1.1 and have a DataGrid which allows
I am using ASP.NET resource internationalization. I have the following structure /App_LocalResources Default.aspx.resx /App_GlobalResources
I need an ASP.Net control on your property you can specify an array type
I am using asp.net 3.5 with the ajax toolkit. The problem: I have a
I'm very new to asp.net and I have a general question about datalists. I
I have an asp.net ajax CollapsiblePanelExtender control on my page. The way this control
I have a user control defined on an page as follows: <uc:MyUserControl ID=MyUserControl runat=server
I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on

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.