Showing posts with label component. Show all posts
Showing posts with label component. Show all posts

Monday, March 26, 2012

HTML entity utility class

Does anyone know of a class or component that maps to and fromHTML entities?

That is, I can pass to it the string "Green Eggs & Ham" and have returned "Green Eggs & Ham", and visa-versa?

Thanks to anyone who can save me the effort of having to type in all these entities myself...

HTML encoding label component - best practice?

Just written a quick little custom control, decended from Label, with an
extract bool property NeedHtmlEncode, that will automatically HTML encode
the Text property.

In the Render method, I can't just use HttpUtility.HtmlEncode(Text) because
it won't deal with fonts, bold etc etc. So I wrote the following bodge to
set the Text property with the encoded value, render as normal, then reset
Text back to it's original value.

I'm sure there is a better way, can anyone help?

Thanks,

John

protected override void Render(HtmlTextWriter output)
{
if (needHtmlEncode)
{
string s = Text;
try
{
Text = System.Web.HttpUtility.HtmlEncode(Text);
base.Render(output);
}
finally
{
Text = s;
}
}
else
// normal, without encoding
base.Render(output);
}

Saturday, March 24, 2012

Html email and embedded images.

Is it possible to embed an image in an html email without a mail component.
If so can you post an example.
Thanks
Ok now I know it is not possible without a component. Is there a freecomponent around that lets you imbed images in to html emails?

HTML DOM Document?

In VB6 I use the DOMDocument (a component) to access the various parts of a HTML webpage like looping through all the <tables>, <a> and <img> and extract the infomation I need.

Is there a DOMDocument object available in ASP.net? Object like HTMLTable, HTMLAnchor, HTMLIMG.

Thanks in advance.

HTML document in aspx page

Hi friends,
I am using .NET 1.1 and write my code in VB. I want to place a HTML or XML document in an aspx page using a frame or a component like that which will let the user go up and down with scroll bars.
Thanks in advance
Regards...You could use an iFrame (http://www.w3schools.com/tags/tag_iframe.asp)
Firstly,
Thank you for your quick response. But i have a strange problem. I added an iframe to my aspx page. It looks very nice. The problem is when i click on "view in browser" it works but F5 does not. I could not solve the problem. (i write my code in vb.net 2003)
thanks for your time.
Regards...
More detail would be good, in what way doesn't it work?
When i press F5 to run the app, i can see iframe on page but there is no data in it. It is blank.
Show your iframe code, and however you are assigning its src attribute.
Hi friends,
Thanks for your time and support. It works fine.
Regards...

Thursday, March 22, 2012

Html Component Question

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>
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.