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

Discussion in 'ASP .Net' started by Sunfire, Nov 6, 2007.

  1. Sunfire

    Sunfire Guest

    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?
     
    Sunfire, Nov 6, 2007
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    >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?
    >
    >
    >
     
    Mark Fitzpatrick, Nov 6, 2007
    #2
    1. Advertising

  3. Sunfire

    Sunfire Guest

    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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:...
    >>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?
    >>
    >>
    >>

    >
    >
     
    Sunfire, Nov 6, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MattB

    hitting "enter" on a page

    MattB, May 24, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    371
    MattB
    May 24, 2004
  2. Nate Hekman

    Hitting Enter in a textbox

    Nate Hekman, Sep 23, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    500
    Matt Berther
    Sep 23, 2004
  3. Andy G

    Hitting the enter key

    Andy G, Dec 27, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,561
    Andy G
    Dec 28, 2004
  4. 23s
    Replies:
    2
    Views:
    3,915
  5. Megha Vishwanath
    Replies:
    3
    Views:
    718
    Megha Vishwanath
    Jul 20, 2004
Loading...

Share This Page