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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:57:12+00:00 2026-05-31T08:57:12+00:00

I am using asp.net/C# for my project.Currently i have a default.aspx page and a

  • 0

I am using asp.net/C# for my project.Currently i have a default.aspx page and a master page.The default.aspx page has many controls , and for each control i have defined class and id. The problem i am facing is that when i apply style to a particular control using the class , the styles are reflected properly, and when i do that using the id of the control the style is not reflected.
I rectified the issue but i dont know how to solve that.
For instance,
I have a textbox with id="txtCustNo" ,, when i apply style like

#txtCustNo{border:1px solid red}

it doesnot reflect ,,,when i apply style like #ctl00_ContentPlaceHolder1_txtCustNo it shows the changes , however the id is txtCustNo..Can somebody point me out where am i going wrong.Thanks .

  • 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-31T08:57:13+00:00Added an answer on May 31, 2026 at 8:57 am

    The ID on server controls is automatically generated and is not the same as the generated ID on the client side.

    You can find what the generated ID with be with this: <%# txtCustNo.ClientID %>

    ASP.NET 4 supports a new ClientIDMode property on the Control base class. The ClientIDMode property indicates how controls should generate client ID values when they render. The ClientIDMode property supports four possible values:

    1. AutoID—Renders the output as in .NET 3.5 (auto-generated IDs which will still render prefixes like ctrl00 for compatibility)
    2. Predictable (Default)— Trims any “ctl00” ID string and if a list/container control concatenates child ids (example: id=”ParentControl_ChildControl”)
    3. Static—Hands over full ID naming control to the developer – whatever they set as the ID of the control is what is rendered (example: id=”JustMyId”)
    4. Inherit—Tells the control to defer to the naming behavior mode of the parent container control

    When using ASP.Net before 4.0 you have to live with the auto generated ID’s.

    For more info on the 4.0 features see this link.

    http://weblogs.asp.net/scottgu/archive/2010/03/30/cleaner-html-markup-with-asp-net-4-web-forms-client-ids-vs-2010-and-net-4-0-series.aspx

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

Sidebar

Related Questions

I'm developing an ASP.Net project. I have an <asp:Table> control on my page, to
I'm using asp.net 3.5, my solution currently has 2 projects, an API class project
In my asp .net C# project I have a page defualt.aspx on which I
I'm currently working on an ASP.NET 4.0 site using a project-less solution. By default
I am currently using ASP.NET MVC1 in my project but now i am planing
I am using ASP.NET Dynamic Data for a project and I have a table
I have an ASP.Net project using AJAX that I am putting on a server
I have implemented Unity within my Asp.Net MVC2 project. I am currently registering my
Currently in the early stages of developing a very large project using ASP.Net MVC.
I have created a new MVC2 project using the ASP.NET MVC2 Web Application, which

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.