How to get Visual Studio to use quotes for html tag attributes

  • Thread starter Thread starter Max
  • Start date Start date
Get used to it. VS is the worst environment to edit HTML ever. If you have
been following the newsgroups for a while you will see many postings about
this. The only things you can do are turn off a couple of options but VS
still mangles and does what it wants (NOT WHAT THE DEVELOPER WANTS- PLEASE
READ MS) so you are stuck with it.

Lloyd Sheen
 
Tools...Options

Choose the "Text Editor"Category
Choose the "HTML/XML" Sub Category
Check "Attribute Value Quotes"
 
With all due respect Lloyd, you are incorrect. There is an option to turn
on that will insert quotes like the OP wants.

Also, VS.NET is a very good HTML editor if you know how to configure it the
way you want. There is IntelliSense, color coding, auto close tags and HTML
Schema validation in this editor. These features alone make it much better
than most editors out there. If you don't like the way the source code gets
re-formatted, you can easily turn that feature off.

I've been hearing people make statements like yours about VS.NET and before
that FrontPage for years. My experience tells me that those comments come
from people who don't know how to configure the product to work the way they
want it to. If you took the time to investigate how you can configure the
product, you'd soon realize that it is one of the best HTML editing
environments out there.
 
Yikes, I'd have to disagree. There bugs and workarounds in VS verified by
Microsoft. I'll also just forget you mentioned the F word in a developers'
newsgroup.

-Max
 
Yikes, I'd have to disagree. There bugs and workarounds in VS verified by
Microsoft. I'll also just forget you mentioned the F word in a developers'
newsgroup.

-Max

My point was that there is a setting to control the HTML editor so that it
will operate the way you want it to and I was comparing that to the moaning
I've heard over the years about FP as well ("FP always changes my code
around."). The bugs you mention in VS.NET 2002 are the reason for VS.NET
2003 and those bugs were not exclusive to the HTML editor (as a matter of
fact, I hadn't heard of a specific bug in the HTML editor at all).

As for the "F" word, it's not taboo. Again, those who like to bash FP, are
those who don't know how to use it. I still use FP for intensive UI
development and then port that code over to VS.NET.
 
I'm not going to go into all the bugs, but I'll just say that people who
don't find any bugs obviously aren't using the software all that much to
find them. I'll note that a lot of the bugs come into the picture when you
go outside the VS IDE and try to use 3rd party apps, which is very common
and nessecary, but Microsoft will have you develop the entire web site
inside VS which is absolutely insane.

Also, FP is really nothing more than a fancy text editor to the pros. VS is
a lot more powerful now as a design tool, and I've finally put FP to
pasture. Although VS is still not up to pair with Dreamweaver which supports
REAL templates. Supposedly VS is coming out with "templates," but from what
I've been reading it's still not quite what Dreamweaver has been doing for
the last 5 years. So I'm hoping the next VS bug fix will work with DW
templates and not change my code (something that cannot be bypassed under
options).

-Max
 
I'm not going to go into all the bugs, but I'll just say that people who
don't find any bugs obviously aren't using the software all that much to
find them.

I've been using VS.NET since early betas and use it every day. Yes, there
are bugs, but what bug in the HTML editor are you referring to?
I'll note that a lot of the bugs come into the picture when you
go outside the VS IDE and try to use 3rd party apps, which is very common
and nessecary, but Microsoft will have you develop the entire web site
inside VS which is absolutely insane.

Would you be specific about the bug you are referring to please?
Also, FP is really nothing more than a fancy text editor to the pros.

Your still not getting my point. I never once said that for serious
development, FP is the way to go. I brought it up as a comparison of what
people (like you) have said about VS.NET vs. what people have said about FP
in the past. The gripe is that the product changes the HTML or won't write
the HTML the way the developer wanted. My point was that this is (in
VS.NET) and always has been (in FP), simple options that can be set to make
the product work the way you want it to. You do remember the OP don't you
.... quotes around attribute values? Tools...Options...Text
Editor...HTML/XML...Attribute Value Quotes.
VS is a lot more powerful now as a design tool, and I've finally put FP to
pasture. Although VS is still not up to pair with Dreamweaver which supports
REAL templates. Supposedly VS is coming out with "templates," but from what
I've been reading it's still not quite what Dreamweaver has been doing for
the last 5 years. So I'm hoping the next VS bug fix will work with DW
templates and not change my code (something that cannot be bypassed under
options).

That's true, but there are still elements of the WYSIWYG that still need
work, specifically table design.
 
Load into VS.NET any page made in dreamweaver that uses a template. Flip
between design view and code view. Watch your DW <!-- InstanceBeginEditable
name="doctitle" --> tags magically move, even with all VS code validation
turned off.

Just TRY to make a user control without closing your html tags -- such as
the first and last part of an html table. I forget what happens, but
basically this is the reason you can't really have serverside
templates/includes using VS.

Table design is easy when you learn how to select groups of cells using the
mouse and cntrl keys. I do wish you could select something in design view
and it would still be selected in code view.

Max
 
Load into VS.NET any page made in dreamweaver that uses a template. Flip
between design view and code view. Watch your DW <!-- InstanceBeginEditable
name="doctitle" --> tags magically move, even with all VS code validation
turned off.

Come on! That's not a bug! It's like saying, "When I take this sqare peg
and try to put it into this round hole...".
Just TRY to make a user control without closing your html tags -- such as
the first and last part of an html table. I forget what happens, but
basically this is the reason you can't really have serverside
templates/includes using VS.

And, when is it appropriate for opening table tags to not have closing table
tags?
Table design is easy when you learn how to select groups of cells using the
mouse and cntrl keys. I do wish you could select something in design view
and it would still be selected in code view.

And, it's even easier using the FP WYSIWYG editor and that is my point.
 
Scott M. said:
Come on! That's not a bug! It's like saying, "When I take this sqare peg
and try to put it into this round hole...".

Well there is no reason for VS to move the tags that would otherwise make DW
compatible with VS, unless it's some conspiracy to prevent people from using
DW templates with VS. I mean it's possible: Microsoft IS releasing their own
form of templates in this next version where a lot of people probably just
stop using DW altogether. Templates are the main reason people use DW.

Anyway, the VS devs say it's a bug and it will be fixed in the next version
(2004). Sorry I don't have the link to show you admitting this. They have
released a workaround, but it does not work in every case. The DW tags are
well formatted comment tags for gods sake, and there is no reason for VS to
be touching them. In some cases VS will actually delete code when it sees
these tags.
And, when is it appropriate for opening table tags to not have closing table
tags?

When you want to make a template based web site. Say you want a two columns
layout. The left column would be the same on every page, and the right
column you want your page content. You can do this quite easily with
dreamweaver and the best part is you don't need user controls or includes.
It's all html managed within Dreamweaver.

<user control (start table)>
your page
<user control (end table)>
 
Max,

For all the grief you've given me about FP, you should lay off the DW stuff.
IMHO, FP is leaps and bounds better than DW (we'll save that discussion for
another place & time), but you keep talking about templates.

You CAN create templates in VS.NET in one of several ways:

Using VS.NET Ent. Architect Edition
A User Control
Page Inheritance

It seems to me that you are a bit "stuck" on DW. Time to let it go.
 
Scott M. said:
Max,

For all the grief you've given me about FP, you should lay off the DW stuff.
IMHO, FP is leaps and bounds better than DW (we'll save that discussion for
another place & time), but you keep talking about templates.

Although this is probably the wrong place to make this argument,
DreamWeaver is better if you ever have to edit the HTML manually. Or,
if you have a nice, clean, manually created page that you need to open
in a graphical editor once, and would prefer that it not change all the
indenting, line-wrapping, etc.

Caveat: I've never had a chance to work with a FrontPage more recent
than FrontPage 2000.

Ricky
 
Although this is probably the wrong place to make this argument,
DreamWeaver is better if you ever have to edit the HTML manually. Or,
if you have a nice, clean, manually created page that you need to open
in a graphical editor once, and would prefer that it not change all the
indenting, line-wrapping, etc.

Caveat: I've never had a chance to work with a FrontPage more recent
than FrontPage 2000.

You apparently haven't read through this whole thread as you've just made my
point....It is very easy to tell FP NOT to change HTML. It always has been.
I edit HTML in FP all the time and have configured it to change the things I
want changed and to leave alone the things I don't want changed.

Nonetheless, people have been saying what you have said about FP for years.
It's simply a matter of learning how to use FP.
 
Scott M. said:
You apparently haven't read through this whole thread as you've just made my
point....It is very easy to tell FP NOT to change HTML. It always has been.
I edit HTML in FP all the time and have configured it to change the things I
want changed and to leave alone the things I don't want changed.

Nonetheless, people have been saying what you have said about FP for years.
It's simply a matter of learning how to use FP.

Apologies for that then -- I only just joined, so missed the rest of the
thread.

As I do all my HTML / .NET programming in a text-editor, I haven't used
either one in years.

Ricky
 
I think it's time for me to let this conversation go. You just aren't
experiencing the bugs I and a lot of others are experiencing. Even the fix
you gave me (Tools/Options/Text Editor) does not work. VS will just not lay
off well formed HTML, and if you read the VS developers' notes and comments
you would see them talking about how the next version of VS will NOT touch
the code. It should be the biggest fix for VS to date. I'm tempted to go
grab the "alpha" version now.

P.S. If User Controls and Page Inheritance are REALLY good for templates
then why are they ADDING the template namespace in the next version of NET?
;)

-Max
 
Hi Max,

I guess will all the info. in this thread, my point is still not clear.

.....You are saying that you didn't get the quotes around your attribute
values despite the Tools...Options setting? Please understand that turning
this feature on will NOT retroactively change the HTML you already have. It
will only affect NEW HTML that you create (or it creates) going forward.
This was never a bug issue for VS.NET. It has worked since day 1. If you
are not getting the quotes, I would suggest that you have a bad installation
of VS.NET.

If you want to have existing HTML changed, and you haven't turned off the
automatic HTML formatting when the page is switched into/out of the HTML
designer in Tools...Options, a simple way to get all the quotes for your
attributes (or apply any HTML formatting option you have turned on/off) is
to select all the HTML in the page and cut it, then just paste it right
back. Because VS.NET will treat the pasted HTML as "new" HTML it will apply
to the current HTML formatting rules (specified in Tools...Options) to what
was pasted.

As for the other "bugs", I've yet to hear someone tell me about a specific,
documented bug regarding THIS issue. I'm talking about "bugs", not
complaints about features that aren't there. A bug is when the software
does something is was not designed to do or vice versa. This has been my
point all along, there were never bugs with the HTML formatting features,
only misunderstanding/no understanding of how to use them.

As for templates, you can get the effect of them today. The new namespace
(and classes) will just formalize the process and make it easier, but it
doesn't mean you can't get the effect today.

HTH

-Scott
 
Back
Top