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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:58:48+00:00 2026-05-23T12:58:48+00:00

The ASP.NET compiler tells me a certain tag does not accept a certain attribute,

  • 0

The ASP.NET compiler tells me a certain tag does not accept a certain attribute, although it builds, and it renders correctly on the browser. It’s a dull warning message.

How can I disable that warning message in certain lines of the ASP.NET code?

The warning pops at this line:

<asp:ListItem Text="" Value="" style="display: none" />

Warning:

Validation (ASP.Net): Attribute 'style' is not a valid attribute of element 'ListItem'.

PS: I just want to disable that warning message for that specified line of code, I don’t want to disable it for the whole project. Is there a way to do this?

  • 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-23T12:58:49+00:00Added an answer on May 23, 2026 at 12:58 pm

    I don’t think you can suppress warnings on aspx code on individual lines because the aspx code is not really processed in a line-by-line manner (it is parsed using an XML-like parser). However, you can get around the warning by setting the style programmatically:

    MyListItemControl.Items(0).Attributes("style") = "display:none;"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note that I'm not talking about the compiler-generated Temporary ASP.NET Files. My web application
Does asp.net compiler change the name of public methods that are declared in a
I'm attempting to build a ASP.NET website using MSBuild - specifically the AspNetCompiler tag.
I'm using the ASP.NET 4.0 compiler to pre-compile my ASP.NET MVC 3 project, and
i created an asp.net web app and it works fine with the compiler. i
I am succesfully building ASP .Net applications in NAnt using the ASP Compiler, without
When I install ASP.NET MVC, am I installing a different run-time, compiler, etc? Or,
I am getting following error for log4Net in Asp.Net 2.0 website. Compiler Error Message:
I am compiling my asp.net app and it works fine with the compiler. I
I have an annoyance, not really a problem. In my ASP.Net 4.0 app, when

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.