1

Why do built-in ASP.NET controls generate HTML that VS2010 tells me is not HTML5 compatible? Is there a way around it?

Example: Drop a PasswordRecovery control onto your page and ask it to convert the UserName (or Question or Answer) view into a template. The generated HTML contains attributes like cellpadding and cellspacing and VS2010 underlines them with the warning: Attribute 'cellspacing' is not a valid attribute of element 'table'.

N.B. You have to set Target Schema to HTML5 to see these warnings.

7
  • coz CELLPADDING and CELLSPACING is obsolute in HTML5.., you can use CSS to use that controls.. Commented Jun 21, 2013 at 6:31
  • @GopeshSharma: Thanks, but that is not what I'm asking. Of course I understand that these attributes are deprecated in HTML5. The question is, why does VS2010 generate these attribs even when Target Schema is set to HTML5 and is there a way to force it to generate HTML5 compatible code? Commented Jun 21, 2013 at 6:34
  • are you using XHTML 1.0 transitional opening incantation?, bdw have you install Web Standards Update? Commented Jun 21, 2013 at 6:38
  • @GopeshSharma: I'm not too sure what that is (being relatively new to ASP.NET). I do see XHTML 1.0 Transactional in the list of Target Schemas, but that is not what I'm using. As I said, I have set it to HTML5. Or are you referring to something else? Commented Jun 21, 2013 at 6:41
  • @Aristos: Wow. I had a hard time making sense out of that, but I guess I understand what you're saying. Thanks for your input. Commented Jun 21, 2013 at 6:46

1 Answer 1

1

At first you should install Web Standards Update And then change the XHTML 1.0 transitional opening incantation to HTML 5 i.e.

<!DOCTYPE html>
<html>
Sign up to request clarification or add additional context in comments.

1 Comment

That sounds interesting. I'll take a look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.