hitting enter or shift+enter in asp.net designer messes up html code?

S

Sunfire

I was wondering if there was a way to hit enter to insert blank lines while
in the designer? I tried this but all it seems to want to do is insert code
that really shouldn't be there. For example, I had a heading 1 centered on a
page. Right under that I had some words in smaller print right under the
heading. When I hit enter after the heading 1, it automatically put the text
right below it in a <p></p> tag. I don't want this sort of stuff to happen
when I hit enter. The other problem I have is when I am creating a heading 1
later on the page and after hitting enter (shift enter) it stayed in the h1
tag and all text I typed was in a heading. Is there any way to stop that?
 
M

Mark Fitzpatrick

This really is the normal way the WYSIWYG editors behave. If you are in a
design and not code view, hitting enter will cerate a new paragraph as it is
designed to mimic a line break and carriage return. Shift+Enter is designed
to immitate a line break (<br />). This is pretty much how all html
designers (not just the MS ones) behave. Here's the problem, if you do
something in the designer, you are designing the page by creating HTML. If
you hit enter, what do you expect it to do? To move to the next line it has
to create HTML, there is no way around this because a simple line break in
the code is whitespace, which is ignored by the browser (as the HTML spec
says).

If you're within a tag such as a header, the designer wants to obey and
create the a simple line break within that tag. Again, this is exactly how
it should be and how other editors behave. Both these behaviors are
something you need to understand and become used to as it's simply how it is
supposed to work and how WYSIWYG editors do work.
 
S

Sunfire

I found that if you have details turned off in vs2005 designer, hitting
enter at the end of a line ignores the fact that you want to have the next
line in the same tag.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top