Royi Namir
Royi Namir

Reputation: 148534

comment css doesnt work on aspx page under vs2010 ?

I'm dealing with an ASPX file

I want to comment a css line. ( ctrl k c)

however it doesn't work in CSS. only on html

How can I fix that ?

enter image description here

Upvotes: 2

Views: 90

Answers (2)

ygssoni
ygssoni

Reputation: 7349

There is no default method for commenting css lines in aspx page. So it just add the asp comments in lines.

But you can record your own macro to perform the action. Refer to this link :

Make Comments for CSS

Upvotes: 1

Nix
Nix

Reputation: 5998

I think Visual Studio only looks at the file extension, not the specific context. Since this is inline styles in a ASPX document, it will simply do HTML (or the ASPX equivalent) comments. It would probably also fail if you used inline Javascript.

If you use a stylesheet with the correct .css extension, it should work as expected and do either single line comments (// ...) or block comments (/* ... */). I believe VS do the latter, but it's been a while since I used it.

(PS: Bonus points for creating an animated gif illustrating the problem).

Upvotes: 1

Related Questions