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

  • Home
  • SEARCH
  • 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 4077230
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:31:28+00:00 2026-05-20T17:31:28+00:00

<asp:Textbox runat=server Id=Username /> This might render as: <input type=text id=ctl00_mainContent_Username /> But in

  • 0
<asp:Textbox runat="server" Id="Username" />

This might render as:

<input type="text" id="ctl00_mainContent_Username" />

But in web.config if I do:

<pages clientIDMode="Static">

This renders as:

<input type="text" id="Username" />

I’ve gone for the second option, so client ID’s are simpler and not dynamic, meaning I can have all my Javascript external because I don’t need to use Username.ClientID.

But why is it designed this way? Why does it give weird names to stuff? The second way just seems easier to work with.

  • 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-20T17:31:28+00:00Added an answer on May 20, 2026 at 5:31 pm

    It’s decorating IDs so that there will never be duplicate IDs on a page even if you use that bit of server-side markup several times on one page.

    Like most ‘decorate this name automatically so that a duplicate can never occur’ schemes, the name ends up long and ugly.

    You have to remember that the original concept of ASP.NET was that nobody would ever look at the output HTML or care about details like IDs, because all that was abstracted away for you. So a simple, ugly, name decoration scheme would be fine – it was just an internal implementation detail.

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

Sidebar

Related Questions

When I would be able to write : <asp:TextBox id=Input runat=server/> <asp:Button onclick=<% Input.Text='my
If I have the following in an ASP.NET Web Form: <asp:TextBox runat=server ID=tbxUser/> and
<asp:TextBox ID=TextBox1 runat=server></asp:TextBox> <asp:Button ID=Button1 runat=server UseSubmitBehavior=false OnClick=Button1_Click OnClientClick=this.disabled = true; this.value = 'Submitting...';
I have the following textbox server control in my web page: <asp:TextBox ID=txtZip runat=server
I'm using the ASP.Net LoginControl for user validation: <asp:Login ID=Login1 runat=server> <LayoutTemplate> <asp:TextBox id=UserName
I am trying to do following: <asp:Login id=loginControl OnAuthenticate=loginControl_Authenticate runat=server> <LayoutTemplate> <asp:TextBox id=UserName runat=server
I have a simple asp:textbox set up like this <asp:TextBox runat=server ID=tbxWarning TextMode=MultiLine Rows=4>
I have <asp:TextBox runat=server ID=lastName /> on a page and I want to set
Consider the following: <form runat=server> <div> <asp:TextBox runat=server ID=tb1 /> <asp:Button runat=server ID=b1 OnClick=b1_Click
<asp:TextBox ID=TextBox5 runat=server Height=30px Width=68px></asp:TextBox> <ajaxToolkit:DropDownExtender ID=TextBox5_DropDownExtender runat=server DynamicServicePath= Enabled=True TargetControlID=TextBox5> </ajaxToolkit:DropDownExtender> //this.TextBox5_DropDownExtender ????

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.