Monday, March 26, 2012
HTML formatted memorystream.. how to return it in its own browser window ?
System.IO.MemoryStream ojbect, how can I use the Response object of my aspx
page to return this result to the user, and in a new window ?
Thanks for any pointers.
MartinHi, Martin
The Response object will only stream back to the window that sends out reque
st. You cannot write to another window.
I would suggest 2 solutions to get around:
1. Save the stream to the session, retrieve it from the new page.
or
2. move the code behind function to the new page, stream to the Response obj
ect.
Bin Song, MCP
HTML formatted memorystream.. how to return it in its own browser window ?
System.IO.MemoryStream ojbect, how can I use the Response object of my aspx
page to return this result to the user, and in a new window ?
Thanks for any pointers.
MartinHi, Marti
The Response object will only stream back to the window that sends out request. You cannot write to another window.
I would suggest 2 solutions to get around
1. Save the stream to the session, retrieve it from the new page
o
2. move the code behind function to the new page, stream to the Response object
Bin Song, MCP
HTML Encoding CRUD data for later display
Hi All,
This is a problem that I have resolved before by writing my own library but I would like to know if there is a better way to do this. The issue with using the library I wrote is that there is quite excess encoding that get stored in the database that I would like to avoid.
I am dealing with content entered on a fron-end using HTML textbox tag into a database and which is later read by a backend system using .NET 2.0 controls. On the backend I return write resposnes to data entered in the from end using TextBox control and I also display them using Label control.
My problem is dealing with the fact the \n \r entered do not seem to be encoded when I display data in Label Tags i.e. everything gets displayed in one long line. Is there an inbuilt way in .NET to solve this. I need to possible solution that would work in both .NET 2 and 1.1 as my solution spans both frameworks. On the Net 1.1 side I actually use HTML tags (non asp.net) so I somehow have to be able to convert my \n to <br/> and so on...
TIA,
Tuka
Hi,
Based on your description, I understand that you need to escape the carriage return \r\n to <br/> using a build-in way of .NET framework. If there is any misunderstanding, please feel free to let me know.
As far as I know, there isn't a build-in method for you to do this conversion. The only way is to write your own library to change \r\n to <br/>. This can be done by either string.Replace or Regular Expression.
Hope this helps.
Thanks for your reply. I think you understood me exactly - I'll just adapt my existing library then
Cheers,
Tuka
Thursday, March 22, 2012
Html Component Question
I found a calendar component tutorial online for html components.
in this component the tag for a script was <SCRIPT
LANGUAGE="JavaScript"></SCRIPT>
here is the problem when i tried this in my own component it would not work
until i used the tag like this
<SCRIPT TYPE="text/javascript"></SCRIPT>
i could understand why this would not work on different browsers but the
calendar project works just fine on my computer so
i dont understand why it did nto work in my project. Is this stuff case
sensitive'
Thanks for the help
WStoreyII"WStoreyII" <papastoreyii@.sbcglobal.net> wrote in message
news:za3Ec.4248$9A.1819@.newssvr27.news.prodigy.com...
> I dont think that it really matters, but just for my own reference?
> I found a calendar component tutorial online for html components.
> in this component the tag for a script was <SCRIPT
> LANGUAGE="JavaScript"></SCRIPT>
The language attribute is deprecated.
> here is the problem when i tried this in my own component it would not
work
> until i used the tag like this
> <SCRIPT TYPE="text/javascript"></SCRIPT>
The type attribute is now required for the script element.
> i could understand why this would not work on different browsers but the
> calendar project works just fine on my computer so
> i dont understand why it did nto work in my project.
Different error correction?
> Is this stuff case
> sensitive'
HTML is not case sensitive.
Cheers
Richard.
rf wrote:
> HTML is not case sensitive.
Bits of it are. Compare <strong>Hello</strong> with <strong>HELLO</strong>.
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
"Toby A Inkster" <tobyink@.goddamn.co.uk> wrote in message
news:pan.2004.06.29.05.25.47.326073@.goddamn.co.uk...
> rf wrote:
>
>
<nitpick>
> Bits of it are. Compare <strong>Hello</strong> with
<strong>HELLO</strong>.
</nitpick> :-)
<pedantic>
HTML is not case sensitive.
The content whose structure the HTML describes may be case sensitive in
certain languages (such as English) where there is such a thing as case
(unlike other languages, such as most South East Asian ones (and especially
Chinese and its derivatives (where there are not even any "letters")) where
there is no concept corresponding to upper and lower case) but the HTML bit
(the stuff inside the start and end tags, the attributes and so on) is not,
with the exception of the value of some of the attributes, such as in the
case of href="http://links.10026.com/?link=example.com" where "example.com" may or may not be case
sensitive depending on which operating system the server is running, however
one could actually argue that the "example.com" bit is actually part of the
content, even though it does not appear as content within an element but
rather as the value of an attribute.
</pedantic>
Cheers
Richard.
then how come it worked when i loaded the calendar example and not on mine?
ill send the demo if you wish
wstoreyii
"rf" <rf@.example.com> wrote in message
news:Oh3Ec.69462$sj4.40260@.news-server.bigpond.net.au...
> "WStoreyII" <papastoreyii@.sbcglobal.net> wrote in message
> news:za3Ec.4248$9A.1819@.newssvr27.news.prodigy.com...
> The language attribute is deprecated.
>
> work
> The type attribute is now required for the script element.
>
> Different error correction?
>
> HTML is not case sensitive.
> --
> Cheers
> Richard.
>
"rf" <rf@.example.com> wrote in message
news:oZ7Ec.69677$sj4.701@.news-server.bigpond.net.au...
> "Toby A Inkster" <tobyink@.goddamn.co.uk> wrote in message
> news:pan.2004.06.29.05.25.47.326073@.goddamn.co.uk...
> <nitpick>
> <strong>HELLO</strong>.
> </nitpick> :-)
> <pedantic> // What is Pedantic'?
> HTML is not case sensitive.
> The content whose structure the HTML describes may be case sensitive in
> certain languages (such as English) where there is such a thing as case
> (unlike other languages, such as most South East Asian ones (and
especially
> Chinese and its derivatives (where there are not even any "letters"))
where
> there is no concept corresponding to upper and lower case) but the HTML
bit
> (the stuff inside the start and end tags, the attributes and so on) is
not,
> with the exception of the value of some of the attributes, such as in the
> case of href="http://links.10026.com/?link=example.com" where "example.com" may or may not be case
> sensitive depending on which operating system the server is running,
however
> one could actually argue that the "example.com" bit is actually part of
the
> content, even though it does not appear as content within an element but
> rather as the value of an attribute.
> </pedantic>
> --
> Cheers
> Richard.
>
"WStoreyII" <papastoreyii@.sbcglobal.net> wrote in message
news:Yp4Ec.79128$ju1.70879@.newssvr29.news.prodigy.com...
> then how come it worked when i loaded the calendar example and not on
mine?
> ill send the demo if you wish
Er, send it where?
Provide a link to the demo and a link to your implementation.
Cheers
Richard.
rf wrote:
>
> Different error correction?
>
>
> HTML is not case sensitive.
>
XHTML is tho.
x theSpaceGirl (miranda)
# lead designer @. http://www.dhnewmedia.com #
# remove NO SPAM to email, or use form on website #
rf wrote:
> <pedantic>
> The content whose structure the HTML describes may be case sensitive in
> certain languages (such as English) where there is such a thing as case
> (unlike other languages, such as most South East Asian ones (and especiall
y
> Chinese and its derivatives (where there are not even any "letters")) wher
e
> there is no concept corresponding to upper and lower case) but the HTML bi
t
> (the stuff inside the start and end tags, the attributes and so on) is not
,
> with the exception of the value of some of the attributes, such as in the
> case of href="http://links.10026.com/?link=example.com" where "example.com" may or may not be case
> sensitive depending on which operating system the server is running, howev
er
> one could actually argue that the "example.com" bit is actually part of th
e
> content, even though it does not appear as content within an element but
> rather as the value of an attribute.
> </pedantic>
Wow, that's one long sentence!
<nitpick>
Whether a link is case-sensitive may depend on operating system, but it
doesn't have to. A server can just as easily be configured to show the
same page for every URL, or show a different one based on the first
letter of the file name and nothing else; there's no requirment to map
URLs on to real files, although that's normally done.
</nitpick>
"Leif K-Brooks" <eurleif@.ecritters.biz> wrote in message
news:2kctk2Fr8kpU1@.uni-berlin.de...
> rf wrote:
especially
where
bit
not,
the
however
the
> Wow, that's one long sentence!
> <nitpick>
> Whether a link is case-sensitive may depend on operating system, but it
> doesn't have to. A server can just as easily be configured to show the
> same page for every URL, or show a different one based on the first
> letter of the file name and nothing else; there's no requirment to map
> URLs on to real files, although that's normally done.
> </nitpick>
True.
--
Cheers
Richard.