From: S N on
i had copied the data from a word file and using control-c i had pasted it
into a richtext textbox in my asp form.

also please tell me how to ensure that regardless of whether the data is
html encoded or not, my server.htmlencode should work alright.


"Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
news:expbSYCmIHA.1208(a)TK2MSFTNGP05.phx.gbl...
> >i have checked the access database. when i open the access table,
>>there also i am finding the rectangular block whereever i expect
>>apostrophe
> .
>>also i have started using server.htmlencode for retrieving values from the
>>database. but it displays the new line characters and paragraph characters
>>(<BR> and <p> notations) stored in the text field as such. meaning instead
> of
>>using these characters as commands for new line it is displaying them as
> it is,
>>ie as "<BR>" and "<p>". in this way the paragraph boundaries has gone.
>
> If access is showing the wrong character that indicates the data is
> corrupt.
>
> If the field contains HTML (which it appears it does if it has <br> and
> <p>
> elements that you expect to be honors) then you should not be using
> Server.HTMLEncode. It has to be assumed that a field containing HTML is
> already HTML encoded.
>
> This is a long thread, I can't remember if you indicated how the data
> arrived in the DB in the first place.
>
> --
> Anthony Jones - MVP ASP/ASP.NET
>
>


From: Mike Brind [MVP] on

"S N" <uandme72(a)yahoo.com> wrote in message
news:%23YLk4eCmIHA.1188(a)TK2MSFTNGP04.phx.gbl...

> "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
> news:expbSYCmIHA.1208(a)TK2MSFTNGP05.phx.gbl...
>> >i have checked the access database. when i open the access table,
>>>there also i am finding the rectangular block whereever i expect
>>>apostrophe
>> .
>>>also i have started using server.htmlencode for retrieving values from
>>>the
>>>database. but it displays the new line characters and paragraph
>>>characters
>>>(<BR> and <p> notations) stored in the text field as such. meaning
>>>instead
>> of
>>>using these characters as commands for new line it is displaying them as
>> it is,
>>>ie as "<BR>" and "<p>". in this way the paragraph boundaries has gone.
>>
>> If access is showing the wrong character that indicates the data is
>> corrupt.
>>
>> If the field contains HTML (which it appears it does if it has <br> and
>> <p>
>> elements that you expect to be honors) then you should not be using
>> Server.HTMLEncode. It has to be assumed that a field containing HTML is
>> already HTML encoded.
>>
>> This is a long thread, I can't remember if you indicated how the data
>> arrived in the DB in the first place.
>>
>> --
>> Anthony Jones - MVP ASP/ASP.NET
>>
>>
>
>
>i had copied the data from a word file and using control-c i had pasted it
>into a richtext textbox in my asp form.
>
> also please tell me how to ensure that regardless of whether the data is
> html encoded or not, my server.htmlencode should work alright.
>
>

I haven't read the whole thread, but pasting directly from Word into a rich
text box is asking for trouble. I recommend pasting from Word into Notepad,
then taking the result and pasting it into the Rich text box. Word
sometimes does odd things with what should be "double quotes". And it
retains a whole load of Word-specific formatting - often over-riding your
carefully crafted css.

--
Mike Brind
Microsoft MVP - ASP/ASP.NET


From: S N on
also please tell me how to ensure that regardless of whether the data is
html encoded or not, my server.htmlencode should work alright.








"Mike Brind [MVP]" <paxtonend(a)hotmail.com> wrote in message
news:OtkF6xHmIHA.1680(a)TK2MSFTNGP06.phx.gbl...
>
> "S N" <uandme72(a)yahoo.com> wrote in message
> news:%23YLk4eCmIHA.1188(a)TK2MSFTNGP04.phx.gbl...
>
>> "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
>> news:expbSYCmIHA.1208(a)TK2MSFTNGP05.phx.gbl...
>>> >i have checked the access database. when i open the access table,
>>>>there also i am finding the rectangular block whereever i expect
>>>>apostrophe
>>> .
>>>>also i have started using server.htmlencode for retrieving values from
>>>>the
>>>>database. but it displays the new line characters and paragraph
>>>>characters
>>>>(<BR> and <p> notations) stored in the text field as such. meaning
>>>>instead
>>> of
>>>>using these characters as commands for new line it is displaying them
>>>>as
>>> it is,
>>>>ie as "<BR>" and "<p>". in this way the paragraph boundaries has gone.
>>>
>>> If access is showing the wrong character that indicates the data is
>>> corrupt.
>>>
>>> If the field contains HTML (which it appears it does if it has <br> and
>>> <p>
>>> elements that you expect to be honors) then you should not be using
>>> Server.HTMLEncode. It has to be assumed that a field containing HTML is
>>> already HTML encoded.
>>>
>>> This is a long thread, I can't remember if you indicated how the data
>>> arrived in the DB in the first place.
>>>
>>> --
>>> Anthony Jones - MVP ASP/ASP.NET
>>>
>>>
>>
>>
>>i had copied the data from a word file and using control-c i had pasted it
>>into a richtext textbox in my asp form.
>>
>> also please tell me how to ensure that regardless of whether the data is
>> html encoded or not, my server.htmlencode should work alright.
>>
>>
>
> I haven't read the whole thread, but pasting directly from Word into a
> rich text box is asking for trouble. I recommend pasting from Word into
> Notepad, then taking the result and pasting it into the Rich text box.
> Word sometimes does odd things with what should be "double quotes". And
> it retains a whole load of Word-specific formatting - often over-riding
> your carefully crafted css.
>
> --
> Mike Brind
> Microsoft MVP - ASP/ASP.NET
>


From: Adrienne Boswell on
Gazing into my crystal ball I observed "S N" <uandme72(a)yahoo.com>
writing in news:#YLk4eCmIHA.1188(a)TK2MSFTNGP04.phx.gbl:

>
>
> "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
> news:expbSYCmIHA.1208(a)TK2MSFTNGP05.phx.gbl...
>> >i have checked the access database. when i open the access table,
>>>there also i am finding the rectangular block whereever i expect
>>>apostrophe
>> .
>>>also i have started using server.htmlencode for retrieving values
>>>from the database. but it displays the new line characters and
>>>paragraph characters (<BR> and <p> notations) stored in the text
>>>field as such. meaning instead
>> of
>>>using these characters as commands for new line it is displaying
>>>them as
>> it is,
>>>ie as "<BR>" and "<p>". in this way the paragraph boundaries has
>>>gone.
>>
>> If access is showing the wrong character that indicates the data is
>> corrupt.
>>
>> If the field contains HTML (which it appears it does if it has <br>
>> and <p>
>> elements that you expect to be honors) then you should not be using
>> Server.HTMLEncode. It has to be assumed that a field containing HTML
>> is already HTML encoded.
>>
>> This is a long thread, I can't remember if you indicated how the data
>> arrived in the DB in the first place.
>>
> i had copied the data from a word file and using control-c i had
> pasted it into a richtext textbox in my asp form.
>
> also please tell me how to ensure that regardless of whether the data
> is html encoded or not, my server.htmlencode should work alright.

I would suggest using a client side script to ensure the data pasted
from Word is going in correctly. Word is notorious for really bad,
bloated markup. Google for WYSIWYG textarea - I like the one from The
Man in Blue at [http://www.themaninblue.com/experiment/widgEditor/].

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

From: Mike Brind [MVP] on

"S N" <uandme72(a)yahoo.com> wrote in message
news:u1pVKANmIHA.3940(a)TK2MSFTNGP05.phx.gbl...

> "Mike Brind [MVP]" <paxtonend(a)hotmail.com> wrote in message
> news:OtkF6xHmIHA.1680(a)TK2MSFTNGP06.phx.gbl...
>>
>> "S N" <uandme72(a)yahoo.com> wrote in message
>> news:%23YLk4eCmIHA.1188(a)TK2MSFTNGP04.phx.gbl...
>>
>>> "Anthony Jones" <Ant(a)yadayadayada.com> wrote in message
>>> news:expbSYCmIHA.1208(a)TK2MSFTNGP05.phx.gbl...
>>>> >i have checked the access database. when i open the access table,
>>>>>there also i am finding the rectangular block whereever i expect
>>>>>apostrophe
>>>> .
>>>>>also i have started using server.htmlencode for retrieving values from
>>>>>the
>>>>>database. but it displays the new line characters and paragraph
>>>>>characters
>>>>>(<BR> and <p> notations) stored in the text field as such. meaning
>>>>>instead
>>>> of
>>>>>using these characters as commands for new line it is displaying them
>>>>>as
>>>> it is,
>>>>>ie as "<BR>" and "<p>". in this way the paragraph boundaries has gone.
>>>>
>>>> If access is showing the wrong character that indicates the data is
>>>> corrupt.
>>>>
>>>> If the field contains HTML (which it appears it does if it has <br> and
>>>> <p>
>>>> elements that you expect to be honors) then you should not be using
>>>> Server.HTMLEncode. It has to be assumed that a field containing HTML
>>>> is
>>>> already HTML encoded.
>>>>
>>>> This is a long thread, I can't remember if you indicated how the data
>>>> arrived in the DB in the first place.
>>>>
>>>> --
>>>> Anthony Jones - MVP ASP/ASP.NET
>>>>
>>>>
>>>
>>>
>>>i had copied the data from a word file and using control-c i had pasted
>>>it into a richtext textbox in my asp form.
>>>
>>> also please tell me how to ensure that regardless of whether the data is
>>> html encoded or not, my server.htmlencode should work alright.
>>>
>>>
>>
>> I haven't read the whole thread, but pasting directly from Word into a
>> rich text box is asking for trouble. I recommend pasting from Word into
>> Notepad, then taking the result and pasting it into the Rich text box.
>> Word sometimes does odd things with what should be "double quotes". And
>> it retains a whole load of Word-specific formatting - often over-riding
>> your carefully crafted css.
>>
>> --
>> Mike Brind
>> Microsoft MVP - ASP/ASP.NET
>>
>
>
> also please tell me how to ensure that regardless of whether the data is
> html encoded or not, my server.htmlencode should work alright.

As Anthony said, if you are entering html code into the database with the
idea that this takes effect when you pull it back to a web page, you do not
want to server.htmlencode it. Since you are using a Rich Text Editor, I am
assuming that this will apply html tags to the text on entry, and you want
them to act on the output.

What you really want to do is to make sure no javascript or clientside
vbscript gets injected. One way to do this is just to reject any input that
contains the string "<script>" in it during your server-side validation.

--
Mike Brind
Microsoft MVP - ASP/ASP.NET