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 formatted email
Can anyone advise me on how to amend the following code to send Html formatted emails? It works perfectly in normal text format - I am a novice programmer.
<%@dotnet.itags.org.PageExplicit="true"Language="VB"Debug="True" %>
<html>
<head>
</head>
<body>
<%
Dim EMailFromAsString = Session("eMailFrom")
Dim EMailToAsString = Request.Form("txtTo")
Dim EMailSubjectAsString ="Your Report"
Dim EMailBodyAsString = Request.Form("txtNewBody")
Dim MySmtpClientAsNew System.Net.Mail.SmtpClient
MySmtpClient.Send(EMailFrom, EMailTo, EMailSubject, EMailBody)%>
Any help appreciated
Anything and everything email and .NET related can be found at:
If you are dealing with 1.1:
http://www.systemwebmail.com
Or 2.0 framework
http://www.systemnetmail.com
Both sites have working examples, diagnostic solutions, and setup
I put together a FAQ in the FAQ Forum:HOW TO: Send using System.Net.Mail
HTH,
Ryan
Saturday, March 24, 2012
HTML Decoding
I have text that I am putting into a label that has been custom formatted by
a text editor and looks like this:
Some outside text <crl>Some inside text</clr> Some outside text
How can I map this to an item in a CSS file so that I can use it to format
the 'Some inside text' portion of the text?
Thanks.
SteveWell I dont think you can map it to CSS without changing it to something CSS
can identify against. So, before you add the text to the label do a string
replace on the crl so it becomes a DIV and manipulate the DIV as you would
any div from CSS. Of course you'll need to close the DIV correctly also.
So:
Some outside text <crl>Some inside text</clr> Some outside text
becomes
Some outside text <div class="crl">Some inside text</div> Some outside text
Regards
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Uriah Piddle" <stephenprescott@.msn.com> wrote in message
news:u10TlMoMHHA.5012@.TK2MSFTNGP02.phx.gbl...
> Hi Gang,
> I have text that I am putting into a label that has been custom formatted
> by a text editor and looks like this:
> Some outside text <crl>Some inside text</clr> Some outside text
> How can I map this to an item in a CSS file so that I can use it to format
> the 'Some inside text' portion of the text?
> Thanks.
> Steve
>
Thanks John.
"John Timney (MVP)" <x_john@.timney.eclipse.co.uk> wrote in message
news:hsCdndgnoeim0jzYnZ2dnUVZ8tqqnZ2d@.ec
lipse.net.uk...
> Well I dont think you can map it to CSS without changing it to something
> CSS can identify against. So, before you add the text to the label do a
> string replace on the crl so it becomes a DIV and manipulate the DIV as
> you would any div from CSS. Of course you'll need to close the DIV
> correctly also.
> So:
> Some outside text <crl>Some inside text</clr> Some outside text
> becomes
> Some outside text <div class="crl">Some inside text</div> Some outside
> text
> --
> Regards
> John Timney (MVP)
> VISIT MY WEBSITE:
> http://www.johntimney.com
> http://www.johntimney.com/blog
>
> "Uriah Piddle" <stephenprescott@.msn.com> wrote in message
> news:u10TlMoMHHA.5012@.TK2MSFTNGP02.phx.gbl...
>
HTML Decoding
I have text that I am putting into a label that has been custom formatted by
a text editor and looks like this:
Some outside text <crl>Some inside text</clr Some outside text
How can I map this to an item in a CSS file so that I can use it to format
the 'Some inside text' portion of the text?
Thanks.
SteveWell I dont think you can map it to CSS without changing it to something CSS
can identify against. So, before you add the text to the label do a string
replace on the crl so it becomes a DIV and manipulate the DIV as you would
any div from CSS. Of course you'll need to close the DIV correctly also.
So:
Some outside text <crl>Some inside text</clr Some outside text
becomes
Some outside text <div class="crl">Some inside text</div Some outside text
--
Regards
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
"Uriah Piddle" <stephenprescott@.msn.comwrote in message
news:u10TlMoMHHA.5012@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
Hi Gang,
>
I have text that I am putting into a label that has been custom formatted
by a text editor and looks like this:
>
Some outside text <crl>Some inside text</clr Some outside text
>
How can I map this to an item in a CSS file so that I can use it to format
the 'Some inside text' portion of the text?
>
Thanks.
>
Steve
>
Thanks John.
"John Timney (MVP)" <x_john@.timney.eclipse.co.ukwrote in message
news:hsCdndgnoeim0jzYnZ2dnUVZ8tqqnZ2d@.eclipse.net. uk...
Quote:
Originally Posted by
Well I dont think you can map it to CSS without changing it to something
CSS can identify against. So, before you add the text to the label do a
string replace on the crl so it becomes a DIV and manipulate the DIV as
you would any div from CSS. Of course you'll need to close the DIV
correctly also.
>
So:
Some outside text <crl>Some inside text</clr Some outside text
becomes
Some outside text <div class="crl">Some inside text</div Some outside
text
>
--
Regards
>
John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
>
>
"Uriah Piddle" <stephenprescott@.msn.comwrote in message
news:u10TlMoMHHA.5012@.TK2MSFTNGP02.phx.gbl...
Quote:
Originally Posted by
>Hi Gang,
>>
>I have text that I am putting into a label that has been custom formatted
>by a text editor and looks like this:
>>
> Some outside text <crl>Some inside text</clr Some outside text
>>
>How can I map this to an item in a CSS file so that I can use it to
>format the 'Some inside text' portion of the text?
>>
>Thanks.
>>
>Steve
>>
>
>
Wednesday, March 21, 2012
HTML Clean up
The idea was to save formatted html for each news article directly to the database, which is then displayed on the article table.
this idea worked fine, but unfortunatly people are using dreamweaver, ms word, and the like to create this html.
Needless to say, nearly 25,000 articles in my database by now, the article table alone grew to about 650MB (80% of the database!).
So I'm going to create a new component for them to create articles.
but, while doing so, I was wondering if there is something one can do, to loop through the database and "clean up" the html or something?
Worse case scenario, i will just leave the existing articles as is, and new articles will have simple html, with a single stylesheet for all articles.
Just would have like to clean up existing articles. That messy htlm, and huge record are crippling the search functionality.You will need to know what sort of 'extra' features these web editors add. You can then use a regex search to go through all the records and remove them (without removing the innertext). You could use SQL for this by directly manipulating the database.
Don't forget to try it on a backup first.