Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > hitting enter or shift+enter in asp.net designer messes up html code?

Reply
Thread Tools

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

 
 
Sunfire
Guest
Posts: n/a
 
      11-06-2007
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?



 
Reply With Quote
 
 
 
 
Mark Fitzpatrick
Guest
Posts: n/a
 
      11-06-2007
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.



--

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression


"Sunfire" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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?
>
>
>



 
Reply With Quote
 
 
 
 
Sunfire
Guest
Posts: n/a
 
      11-06-2007
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.
"Mark Fitzpatrick" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
>
> --
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - Expression
>
>
> "Sunfire" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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?
>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Hitting the enter key Andy G ASP .Net 3 12-28-2004 04:57 PM
Hitting Enter in a textbox Nate Hekman ASP .Net 9 09-23-2004 09:31 PM
STRUTS-<html:submit> -Hitting enter key does not submit the form Megha Vishwanath Javascript 3 07-20-2004 05:45 AM
hitting "enter" on a page MattB ASP .Net 2 05-24-2004 09:54 PM



Advertisments