I'm quite new to ASP.NET and Visual Studio. I'm working on an old project, is it possible for me to turn on HTML 5 semantic markup? I've not been able to find the option, I would have expected the option here! :
I'm using Visual Studio 2010 Ultimate
The following is a screenshot of the new project dialog.
Link to a similar topic containing a variety of answers:
Is it possible to add HTML5 validation to Visual Studio?
Download link for the VS 2010 update which gives HTML5 validation:
http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
Answer to my question:
Install the update, and when developing HTML:
Right click > Formatting and Validation > Validation > Target: HTML5.
Alternatively you can select HTML5 from the drop down above the text area, next to the 'Check page for accessibility button'.
Related
I am developing HTML lessons for a youth summer camp and I would like to copy HTML snippets from source view then paste them in design view between <code><pre></pre></code> and have Visual Studio 2013 automatically replace < > with < > accordingly.
I researched and found the article Paste Operations in the HTML Designer of Visual Web Developer and it indicates there is an additional option in the edit menu called paste alternative but as you can see in this screenshot, there is no such option. Is it possible to change a setting or something to add such an option?
I'm not sure of your Visual Studio specific feature but Try this:
http://r12a.github.io/apps/conversion/
Will "Copy as HTML" vs2013 extension will help you?
https://visualstudiogallery.msdn.microsoft.com/98fef791-eb65-4cdf-bf84-077b98c234cf
I'm using Visual Studio 2013 to create raw HTML pages (i.e. index.html).
In my HTML I am implementing custom HTML tags. As such, Visual Studio underlines my custom tags with squiggly lines (due to the warning of "Unknown element ...").
In hopes to get rid of the squigglies, I added my custom tags to the list of "Tag Specific Options" via Tools > Options > Text Editor > HTML (Web Forms) > Formatting > Tag Specific Options. However, the squiggly lines persist.
Is there a way to inform VS2013 that my custom HTML tags are valid (i.e. keep VS2013 from underlining my custom tags with squigglies)?
Visual Studio 2013 Update 4 removes the validation in .html files, but not in .aspx files.
Support for custom elements, polymer-elements and attributes
We no longer validate unknown attributers for custom elements as there
will be many custom made tags in different frameworks. So there will
no longer be squiggles under the unknown elements.
— Announcing new Web Features in Visual Studio 2013 Update 4 RC
Download Visual Studio 2013 Update 4.
Validation is only removed in the HTML editor, not the HTML (Web Forms) editor. This means that, by default, .html files will not have custom element validation, but .aspx pages will. If, like me, you don't think this makes sense, show your support by voting for custom elements in .aspx files.
Hmm... what are you trying to accomplish? Keep in mind that if you could somehow make visual studio ignore the unknown element, that's no guarantee browsers looking at your page will be able to translate the element too.
Are your pages HTML5? if so you've got a shot at making it work. but you'll have to define it in client code. Here is source.
But most browsers don't support it yet! look at here elements.
In the case of making Visual Studio recognise the tags you could take this approach:
1) Go to: Tools > Options > Text Editor > HTML (Web Forms) > Formatting
2) Press "Tag Specific Options"
3) Select "Client HTML Tags" in the new window's treeview
4) Press "New Tag" below the treeview to add a new tag
I'm working on a HTML5 / CSS 3.0 / MVC 3 project in Visual Studio 2010. Every time I restart VS and then open a CSS file, it's always set to 'CSS 2.1'. Is there a way to tell VS I want to use CSS 3.0 always (or at least by default)?
BTW, I have looked under "Tools>Options>Text Editor>HTML" - no CSS options, default is HTML5. I have also looked under "Tools>Options>Text Editor>CSS" - no version option as far as I can see.
Thanks,
Michael
I had a similar problem after SP1.
I had to specifically install the "CSS 3 Intellisense Schema" found here -->
http://visualstudiogallery.msdn.microsoft.com/7211bcac-091b-4a32-be2d-e797be0db210
Restart VS and it started remembering what I had set last. HTH
The default CSS schema is defined by the selected HTML schema, but there is no UI to change the CSS schema targeted by the HTML schema. You will have to do it manually by editing the appropriate HTML schema.
To have HTML 5 target CSS 3.0, edit
"\Microsoft Visual Studio 10.0\Common7\Packages\schemas\html\html_5.xsd"
and change vs:cssschema to "CSS 3.0".
Installing:
Web Standards Update for Microsoft Visual Studio 2010 SP1
also makes VS remember CSS 3.0 validation setting.
Web Standards Update provides the much wanted HTML5 & CSS3 support to
Visual Studio 2010 SP1. It brings VS 2010 intellisense & validation as
close to W3C specification as we could get via means of an extension.
The most notable supported features by this extension are:
HTML5 – Video, Audio, Input Type, Drag & Drop, WAI-ARIA, Microdata,
Schema.org Browser API – GeoLocation & Local Storage CSS3 – 2D
Transforms, 3D Transforms, Animations, Background & Borders, Basic Box
Model, Basic UI, Behavior, Color, Flexible Box Layout, Fonts, Paged
Media, Hyperlink Presentation, Line, Lists, Marquee, Media Queries,
Multi Column, Namespaces, Presentation Levels, Ruby, Selectors,
Speech, Syntax, Template Layout, Text & Transitions. It also supports
vendor specific prefixes like –ms, -webkit & -moz.
Download the latest Visual Studio 2010 update at
http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83
"Web Standards Update for Microsoft Visual Studio 2010 SP1" adds CSS3 support and updates the HTML5 intellisense and validation including new JavaScript API's
Installation Notes:
Don't install this update if you have installed your visual studio to a different directory instead of the default directory.
I'm look for a subsonic 3.0 Add-in tools for visual studio like what was provided for Subsonic 2.
Any alternative tools. I find using the T4 templates annoying.
thanks.
Click on the project that contains the SubSonic templates, then click on the button at the top of Solution Explorer that that says Transform Text Templates, then wait. Use your output window to verify that SubSonic has refreshed all templates.
That's all there is to it.
Consider the feature in Visual Studio 2010 for snippets in the HTML Source view of a web page.
type a control name in plaintext with no markup or brackets!
... e.g. hyperlink.
Then hit Tab
Your web control has been auto-completed for you. It's up to you to fill in the other details that you need.
This works for form as well:
<form action="default.aspx" method="post">
</form>
This looks like a real time saver. This is supported in WebForms and ASP.NET MVC projects.
What other snippets are available in Visual Studio 2010 in the Source view of a page?
For the authoritative list of snippets, check out the VS2010 installation folders where the snippets are stored:
C:\Program Files\Microsoft Visual Studio 10.0\Web\Snippets\HTML\1033
There is one folder for ASP.NET and one for plain HTML snippets.
Also, if you use jQuery a lot, there is a set of jQuery snippets that you can add to Visual Studio as well.
Here are a ton (100's) of the short cuts in Visual Studio right from MSDN:
http://msdn.microsoft.com/en-us/library/da5kh0wa.aspx
The one thing that has been around forever but a lot of people forget about is block selection done by holding down the ALT key and use the mouse to select a block of text. Great when you want to copy/cut/delete a bunch of code that is lined up but you don't want the whole line.
Yeah, this is a really cool new set of snippets in VS2010. Here are the articles I used to learn it:
Walkthrough: Using HTML
Snippets
Using HTML Code Snippets in Visual
Studio 2010