473,395 Members | 1,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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></ptag. 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?

Nov 6 '07 #1
2 1650
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" <a_*****@sbcglobal.netwrote in message
news:ud**************@TK2MSFTNGP04.phx.gbl...
>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></ptag. 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?

Nov 6 '07 #2
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" <ma******@fitzme.comwrote in message
news:ef**************@TK2MSFTNGP05.phx.gbl...
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" <a_*****@sbcglobal.netwrote in message
news:ud**************@TK2MSFTNGP04.phx.gbl...
>>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></ptag. 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?


Nov 6 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
Hello, I have an input box and a button and when the user clicks the button, the contents of the input box are placed on the page in list form. But, when the enter key is used it's as if the page...
3
by: |-|erc | last post by:
these 3 lines will put the following into the URL bar! but with 2 input boxes it doesn't. <form name=test> <INPUT name='selqty2'> </form> file:///C:/WINDOWS/DESKTOP/tttt2.html?selqty2=55555
1
by: ritelman | last post by:
Hi I have one text field and one submit button. If I hit the submit button with a mouse the key/value pair key are properly submitted. However, if I just hit the enter key the page does get...
3
by: Megha Vishwanath | last post by:
Hi, I have a struts form <html:form> in which although the focus rests on the submit button, hitting the enter key does not submit the form. I tried capturing the Enter key event and followed...
10
by: Deano | last post by:
I think that just about sums it up. Is there a fix/workaround for this?It's quite annoying behaviour and not user-friendly.thanksMartin
9
by: Nate Hekman | last post by:
As I've mentioned a couple of times in the last few minutes(!), I've got a simple form with an edit box and a Submit button. If I type something in the Edit box and hit Enter I hear a click but...
2
by: 23s | last post by:
My site's login page has a form w/ 2 textboxes and a submit button. If I'm in either of those textboxes (i.e., either one of the textboxes has focus), in any given browser, hitting "enter" on my...
5
by: TS | last post by:
for some reason, it posts to the server, but no click events of any buttons on form fire. the button is the first one on the form. when the focus is inside the textbox, it doesnt' work. if i click...
6
by: Paul Furman | last post by:
I'm getting incorrect response when hitting the enter key instead of actually clicking the button on a form. It activates but the post data isn't being sent I think. The php generated page...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.