Thursday, March 29, 2012
HTML Image buttons
I am using HTML image buttons in my web application and
when I run it, all my image buttons are showing up with a
border.
I tried using border="0" with the input tag, but it is
deprecated.
<input border="0" src="http://pics.10026.com/?src=../images/next.jpg"
type="image" onclick="return checkPage('next');"
runat="server"/
Can anyone suggest me an alternative?
Thanks!
HTML Image buttons
I am using HTML image buttons in my web application and
when I run it, all my image buttons are showing up with a
border.
I tried using border="0" with the input tag, but it is
deprecated.
<input border="0" src="http://pics.10026.com/?src=../images/next.jpg"
type="image" onclick="return checkPage('next');"
runat="server"/
Can anyone suggest me an alternative?
Thanks!Hello,
Never had this issue, but you can try applying the "style" attribute
disabling any borders for the input control (provided the border is not the
focus frame indicating the control the keyboard input will be directed to).
You can inhibit the focus rect by adding HIDEFOCUS="true" but this will work
in IE only.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"itsme" <anonymous@.discussions.microsoft.com> wrote in message
news:082401c3984e$d5350a80$a101280a@.phx.gbl...
> Hello,
> I am using HTML image buttons in my web application and
> when I run it, all my image buttons are showing up with a
> border.
> I tried using border="0" with the input tag, but it is
> deprecated.
> <input border="0" src="http://pics.10026.com/?src=../images/next.jpg"
> type="image" onclick="return checkPage('next');"
> runat="server"/>
> Can anyone suggest me an alternative?
> Thanks!
Hello,
Never had this issue, but you can try applying the "style" attribute
disabling any borders for the input control (provided the border is not the
focus frame indicating the control the keyboard input will be directed to).
You can inhibit the focus rect by adding HIDEFOCUS="true" but this will work
in IE only.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"itsme" <anonymous@.discussions.microsoft.com> wrote in message
news:082401c3984e$d5350a80$a101280a@.phx.gbl...
> Hello,
> I am using HTML image buttons in my web application and
> when I run it, all my image buttons are showing up with a
> border.
> I tried using border="0" with the input tag, but it is
> deprecated.
> <input border="0" src="http://pics.10026.com/?src=../images/next.jpg"
> type="image" onclick="return checkPage('next');"
> runat="server"/>
> Can anyone suggest me an alternative?
> Thanks!
HTML If then statements?
If so, how would you do it?
I know how to do it in vb.net using an aspx page, but I don't know how to do it using strictly HTML.
ThanksNo,
HTML is a mark up language only. Now you can use some other technologies such as asp, javascript, cgi, etc. to do this. There might also be a way to handle this at the server level also, but I am not so wise in that subject to offer a solution. Maybe someone else is.
In HTML? No, but you can use JavaScript to do it...
Check out http://www.dynamicdrive.com they have some scritps there that can do that...
TG
:wave:
HTML Grid Layout Panel - should this control be used?
There are some areas on my web pages, however, where I would like to have a little more control on control placement (rather than using a whole lot of tables to control positioning). The HTML Grid Layout Panel control seems well suited for this. My question is, are there any reasons why this control should be avoided (e.g. is it similar to using the Grid Layout mode for web pages which, apparently, should be avoided)? I don't want to run into a situation where I do a lot of work with HTML Grid Layout Panels, only to discover there are issues or browser compatibility problems.
Thanks!
HTML Frames.....
developed using the HTML frames? Does all the browsers support them?
Thank you for your suggestion,
NishAll browsers support frames, not all support iframes. I have never liked
frames and have always considered them old technology. Frames will exist
for a long time, but people have many choices for segmenting their pages.
They can use master pages. Or SmartNavigation. Or scrollable divs.
Just like any technology, it is more important to learn when to use
something rather than assuming that it might be obsolete.
"Nish" <Nish1989@.hotmail.com> wrote in message
news:%23YD$RzmRGHA.4332@.TK2MSFTNGP10.phx.gbl...
> Is HTML frame is an old technology? Will the modern web application are
> developed using the HTML frames? Does all the browsers support them?
> Thank you for your suggestion,
> Nish
>
Hi,
Peter Rilling wrote:
> All browsers support frames
Actually, not all browsers support frames. Mobile devices often don't,
or support them partly only. If the OP's website might be displayed on
mobile devices (PDAs, mobile phones), then I would rather avoid using
frames.
>, not all support iframes. I have never liked
> frames and have always considered them old technology. Frames will exist
> for a long time, but people have many choices for segmenting their pages.
> They can use master pages. Or SmartNavigation. Or scrollable divs.
> Just like any technology, it is more important to learn when to use
> something rather than assuming that it might be obsolete.
Frames have however one advantage over master pages or div: only parts
of the loaded "page" (I mean here page as a whole, meaning the frameset
and all frames) can be refreshed separately. It *can* be an advantage
(stress on *can*) in some situation, for example if one of the frame
contains a very big HTML table (in which case one might consider a
paging solution better, but anyway...).
It's possible to achieve the same with DIVs too, for example with AJAX.
However, it's more complicated and requests a good understanding of web
services, DOM, etc... as well as of the compatibility problems between
browsers.
Frames have a few di
frames is awkward, especially because synchronization problems are
involved: It's relatively complex for one frame to know for sure what
another frame's current state is. It's possible, but it needs a good design.
Also, the displayed URL does not necessarily correspond to a unique
state (because it's the frameset's URL and not a URL corresponding to
each of the loaded frames). This sounds like a very philosophical
problem, but it has implications one should be aware of. Again, it's
possible to solve this (for example using query strings on the
frameset's URL), but it's awkward and complicated.
I try to avoid using frames if I can, but I agree that you cannot really
call them obsolete. There are situations where they make sense. It's
good to be aware of the problems and advantages mentioned here to be
able to make an informed decision.
HTH,
Laurent
> Is HTML frame is an old technology?
I wouldn't call it a technology really. Just part of HTML.
> Will the modern web application are
> developed using the HTML frames?
Probably, though I hope not, as frames are usually implemented by developers
rather poorly. There's usually a better way to accomplish something rather
than resorting to frames.
Of coruse, there times when frames are useful.
> Does all the browsers support them?
Not sure if text browsers can handle them, but the major visual browsers
should be OK.
-Darrel
HTML Frames.....
developed using the HTML frames? Does all the browsers support them?
Thank you for your suggestion,
NishAll browsers support frames, not all support iframes. I have never liked
frames and have always considered them old technology. Frames will exist
for a long time, but people have many choices for segmenting their pages.
They can use master pages. Or SmartNavigation. Or scrollable divs.
Just like any technology, it is more important to learn when to use
something rather than assuming that it might be obsolete.
"Nish" <Nish1989@.hotmail.com> wrote in message
news:%23YD$RzmRGHA.4332@.TK2MSFTNGP10.phx.gbl...
> Is HTML frame is an old technology? Will the modern web application are
> developed using the HTML frames? Does all the browsers support them?
> Thank you for your suggestion,
> Nish
Hi,
Peter Rilling wrote:
> All browsers support frames
Actually, not all browsers support frames. Mobile devices often don't,
or support them partly only. If the OP's website might be displayed on
mobile devices (PDAs, mobile phones), then I would rather avoid using
frames.
>, not all support iframes. I have never liked
> frames and have always considered them old technology. Frames will exist
> for a long time, but people have many choices for segmenting their pages.
> They can use master pages. Or SmartNavigation. Or scrollable divs.
> Just like any technology, it is more important to learn when to use
> something rather than assuming that it might be obsolete.
Frames have however one advantage over master pages or div: only parts
of the loaded "page" (I mean here page as a whole, meaning the frameset
and all frames) can be refreshed separately. It *can* be an advantage
(stress on *can*) in some situation, for example if one of the frame
contains a very big HTML table (in which case one might consider a
paging solution better, but anyway...).
It's possible to achieve the same with DIVs too, for example with AJAX.
However, it's more complicated and requests a good understanding of web
services, DOM, etc... as well as of the compatibility problems between
browsers.
Frames have a few disadvantages: Client-side communication between
frames is awkward, especially because synchronization problems are
involved: It's relatively complex for one frame to know for sure what
another frame's current state is. It's possible, but it needs a good design.
Also, the displayed URL does not necessarily correspond to a unique
state (because it's the frameset's URL and not a URL corresponding to
each of the loaded frames). This sounds like a very philosophical
problem, but it has implications one should be aware of. Again, it's
possible to solve this (for example using query strings on the
frameset's URL), but it's awkward and complicated.
I try to avoid using frames if I can, but I agree that you cannot really
call them obsolete. There are situations where they make sense. It's
good to be aware of the problems and advantages mentioned here to be
able to make an informed decision.
HTH,
Laurent
> Is HTML frame is an old technology?
I wouldn't call it a technology really. Just part of HTML.
> Will the modern web application are
> developed using the HTML frames?
Probably, though I hope not, as frames are usually implemented by developers
rather poorly. There's usually a better way to accomplish something rather
than resorting to frames.
Of coruse, there times when frames are useful.
> Does all the browsers support them?
Not sure if text browsers can handle them, but the major visual browsers
should be OK.
-Darrel
html forms in aspx pages
Here's my form tag syntax and some delivery hidden fields.
<form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
method="POST" onsubmit="return verify();">
<input type="hidden" name="recipient" value=me@dotnet.itags.org.mymail.net />
<input type="hidden" name="redirect"
value="http://www.xxx.org/forms/confirmation.htm" />
...............
...............
rest of form.
I have the form within <asp:content> tags of an asp web form page. Is that
the problem? Do html forms need to be in a file with an html extension and
not a web form. This web form uses a masterpage. I did try putting the html
forms in the masterpage -- but that didn't seem to affect anything.
The form recognizes the reset button and clears the form, but when I submit
it simply reloads the page -- and doesn't access the delivery.cgi file nor
send me the results nor redirect to the confirmation page.
Thanks for any help.When you say you can't get it to submit properly - what exactly do you mean
(what happens)?
I've never tried the 'old' way of doing forms in a content page, so I'm not
exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
instead - I do that all the time and it works fine...
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"thersitz" <thersitz@.gmail.com> wrote in message
news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
> I can't seem to get my html form to submit properly from within a web
form.
> Here's my form tag syntax and some delivery hidden fields.
> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
> method="POST" onsubmit="return verify();">
> <input type="hidden" name="recipient" value=me@.mymail.net />
> <input type="hidden" name="redirect"
> value="http://www.xxx.org/forms/confirmation.htm" />
> ...............
> ...............
> rest of form.
> I have the form within <asp:content> tags of an asp web form page. Is that
> the problem? Do html forms need to be in a file with an html extension and
> not a web form. This web form uses a masterpage. I did try putting the
html
> forms in the masterpage -- but that didn't seem to affect anything.
> The form recognizes the reset button and clears the form, but when I
submit
> it simply reloads the page -- and doesn't access the delivery.cgi file nor
> send me the results nor redirect to the confirmation page.
> Thanks for any help.
>
>
>
>
>
You can't nest HTML forms inside each other.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"thersitz" <thersitz@.gmail.com> wrote in message
news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
>I can't seem to get my html form to submit properly from within a web form.
>Here's my form tag syntax and some delivery hidden fields.
> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
> method="POST" onsubmit="return verify();">
> <input type="hidden" name="recipient" value=me@.mymail.net />
> <input type="hidden" name="redirect"
> value="http://www.xxx.org/forms/confirmation.htm" />
> ...............
> ...............
> rest of form.
> I have the form within <asp:content> tags of an asp web form page. Is that
> the problem? Do html forms need to be in a file with an html extension and
> not a web form. This web form uses a masterpage. I did try putting the
> html forms in the masterpage -- but that didn't seem to affect anything.
> The form recognizes the reset button and clears the form, but when I
> submit it simply reloads the page -- and doesn't access the delivery.cgi
> file nor send me the results nor redirect to the confirmation page.
> Thanks for any help.
>
>
>
>
>
Thanks David. I am really new to asp.net, and feel I am drowning.
Well, my action attribute is suppose to go to this
<action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
read and then delivered and then send the user to a confirmation page. All
that happens in my aspx file is that the page reloads and nothing seems to
get sent anywhere.
I tried using the asp.net controls to build the form -- and still use the
delivery.cgi to parse it -- but then I was getting post back errors.
If I build the form using all asp.net controls -- and not use any regular
html form tags -- how do I get it to deliver say an email to a set of
recipients?
I appropriately have an asp for dummies book and it seems to suggest just
using html form tags -- and when doing so, the page builds fine and displays
fine. The reset button clears the form. But submitting just reloads the very
same page instead of routing to the cgi file handler.
"David Wier" <david_wier@.noSpamhotmail.com> wrote in message
news:uzZ0r%23nOHHA.3212@.TK2MSFTNGP02.phx.gbl...
> When you say you can't get it to submit properly - what exactly do you
> mean
> (what happens)?
> I've never tried the 'old' way of doing forms in a content page, so I'm
> not
> exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
> instead - I do that all the time and it works fine...
> --
> David Wier
> MVP/ASPInsider
> http://aspnet101.com
> http://aspexpress.com
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
> form.
> html
> submit
>
The problem here, is the form deal, as Kevin pointed out - - - (doah! -
wasn't thinking clearly enough)
The way this is normally done is creating the form itself (without the form
tags), and then adding a button. Then, inside the button's click event, you
create everything that you need done with the form.
Not totally sure, again, with the cgi aspect of this - but check out this
sample on crosspage posting and see if you can get it started that way:
age" target="_blank">http://quickstarts.asp.net/QuickSta...ossp
age
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"thersitz" <thersitz@.gmail.com> wrote in message
news:uVpBYQoOHHA.4604@.TK2MSFTNGP06.phx.gbl...
> Thanks David. I am really new to asp.net, and feel I am drowning.
> Well, my action attribute is suppose to go to this
> <action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
> read and then delivered and then send the user to a confirmation page. All
> that happens in my aspx file is that the page reloads and nothing seems to
> get sent anywhere.
> I tried using the asp.net controls to build the form -- and still use the
> delivery.cgi to parse it -- but then I was getting post back errors.
> If I build the form using all asp.net controls -- and not use any regular
> html form tags -- how do I get it to deliver say an email to a set of
> recipients?
> I appropriately have an asp for dummies book and it seems to suggest just
> using html form tags -- and when doing so, the page builds fine and
displays
> fine. The reset button clears the form. But submitting just reloads the
very
> same page instead of routing to the cgi file handler.
>
> "David Wier" <david_wier@.noSpamhotmail.com> wrote in message
> news:uzZ0r%23nOHHA.3212@.TK2MSFTNGP02.phx.gbl...
way,
action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
>
Yes it does. Thanks, Kevin.
Could I do this in my masterpage:
<form id="form1" runat="server"
action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">
And then build a web form linking that masterpage and when submitting have
the server send the results to the cgi file cited so that the cgi file
parses and delivers -- like my other html forms?
"Kevin Spencer" <unclechutney@.nothinks.com> wrote in message
news:OyRe8NoOHHA.4172@.TK2MSFTNGP04.phx.gbl...
> You can't nest HTML forms inside each other.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Bit Player
> http://unclechutney.blogspot.com
> In case of Minimalism, break Philip Glass.
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
>
Another method is to put the "regular" HTML form outside the WebForm
(outside of the <form...>...</form> tags) in the ASP.Net page. Of course,
you would have to change your method of adding the "plain HTML" form code, a
server-side include, for example.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"David Wier" <david_wier@.noSpamhotmail.com> wrote in message
news:e7u7ZeoOHHA.400@.TK2MSFTNGP04.phx.gbl...
> The problem here, is the form deal, as Kevin pointed out - - - (doah! -
> wasn't thinking clearly enough)
> The way this is normally done is creating the form itself (without the
> form
> tags), and then adding a button. Then, inside the button's click event,
> you
> create everything that you need done with the form.
> Not totally sure, again, with the cgi aspect of this - but check out this
> sample on crosspage posting and see if you can get it started that way:
> spage" target="_blank">http://quickstarts.asp.net/QuickSta...os
spage
>
> --
> David Wier
> MVP/ASPInsider
> http://aspnet101.com
> http://aspexpress.com
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:uVpBYQoOHHA.4604@.TK2MSFTNGP06.phx.gbl...
> displays
> very
> way,
> action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
>
I just gave you a suggestion in another post in this same thread. See if you
like it. The important thing to remember is that a WebForm is, on the client
side, an HTML form, and you can't nest HTML forms inside one another. How
you work around that is up to you, but I did make a suggestion.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"thersitz" <thersitz@.gmail.com> wrote in message
news:uCL49goOHHA.4172@.TK2MSFTNGP04.phx.gbl...
> Yes it does. Thanks, Kevin.
> Could I do this in my masterpage:
> <form id="form1" runat="server"
> action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">
> And then build a web form linking that masterpage and when submitting have
> the server send the results to the cgi file cited so that the cgi file
> parses and delivers -- like my other html forms?
>
> "Kevin Spencer" <unclechutney@.nothinks.com> wrote in message
> news:OyRe8NoOHHA.4172@.TK2MSFTNGP04.phx.gbl...
>
Monday, March 26, 2012
HTML file server side includes plus forms authentication
massive dll written in C++ that produces most of the output from a SQL 7.0
data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
code is being written in C# using ASP.NET and we are using forms
authentication to control access to particular directories/applications.
We are having a hard time figuring out how to configure the thing so that
existing html files both a) have access controlled through ASP.NET forms
authentication and b) render server side includes correctly. If we
configure the htm/html files for the application on IIS to be handled by
ssinc.dll the includes are rendered correctly, but access is not restricted
by forms authentication. If we configure them to be handled by
aspnet_isapi.dll we get forms authentication control, but the includes are
ignored.
Oddly, simply renaming a file from *.html to *.aspx with no other changes
results in aspnet_isapi.dll handling it correctly -- providing forms
authentication access control and also rendering includes correctly. But if
the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
includes. It almost seems like this is a bug! I cannot, at any rate, see
any reason why it would do this by design.
So, in theory, we could solve the problem by just re-naming all our htm/html
files with an aspx extension instead. Unfortunately this is not so easily
done in practice since the old C++ .dll that creates most pages and fills
them with stuff from the data base has hyperlinks to the *.html files hard
coded into it all over the place. It is not impossible to change this, but
we'd like to find a simpler way.
Can anyone offer a suggestion for a way to resolve this problem? Is it
simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
fails to do so for an otherwise identical files with a .htm or .html
extension?
All the best,
will
William F. Zachmann, President
Canopus Research Inc.
http://www.canopusresearch.comHi William!
> Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
I don't think it's a bug. Probably your IIS is configured in way that
*.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
change this mapping (for IIS 6) go to "Application settings" (tab "Home
directory" or "Virtual directory")
"Application settings", click "Configuration". On the "Mapping" tab, have a
look at the "Application extension", especially the ".aspx" mapping. Create
a similar extension mapping for ".htm" and ".html".
Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
need more control you will need a custom http handler.
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
Alex,
Apparently I was not clear enough. I had already done that. IIS is already
handling my htm/html files through aspnet_isapi.dll. That brings them under
forms control access, but the includes are not rendered correctly. If I
re-name them to *.aspx, then they are handled correctly. Named *.htm/html
(with those extensions mapped to aspnet_isapi.dll) forms control works, but
includes are not rendered. If I map them to ssinc.dll, then includes are
rendered but I get no forms based access control.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:F8316EA5-66A5-493A-BFE3-93334F741F13@.microsoft.com...
> Hi William!
>
> I don't think it's a bug. Probably your IIS is configured in way that
> *.aspx files are handled by aspnet_isapi.dll, but .htm/.html are not. To
> change this mapping (for IIS 6) go to "Application settings" (tab "Home
> directory" or "Virtual directory")
> "Application settings", click "Configuration". On the "Mapping" tab, have
> a
> look at the "Application extension", especially the ".aspx" mapping.
> Create
> a similar extension mapping for ".htm" and ".html".
> Now IIS will handle your .htm files using aspnet_isapi.dll. If you still
> need more control you will need a custom http handler.
> Alex
> http://www.DotNet42.com - The Answer to Your DotNet Question
>
>
>
> "William F. Zachmann" wrote:
>
Will,
how about this:
1. Rename your .html files to .aspx
2. For the .html hyperlinks generated by your DLL you write an HTTP Handler
that does an URL rewrite from .html to .aspx.
For example this is what happens when you click on
http://www.dotnet42.com/NG_microsof...drawing/A_605/T
hreadDetail.htm
Alex
http://www.DotNet42.com - The Answer to Your DotNet Question
"William F. Zachmann" wrote:
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not restricte
d
> by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
if
> the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our htm/ht
ml
> files with an aspx extension instead. Unfortunately this is not so easily
> done in practice since the old C++ .dll that creates most pages and fills
> them with stuff from the data base has hyperlinks to the *.html files hard
> coded into it all over the place. It is not impossible to change this, bu
t
> we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
>
asp.net processing is a two part
1) map file extension to asp.net dll - this enables form authenication
2) <@. page > directive is found, this causes the page to processed as an
asp.net page and implements the include logic.
you can just add the <@.page> directive to your html pages and you're good to
go.
-- bruce (sqlwork.com)
"William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
> We've got a project going that involves moving an old web site with a
> massive dll written in C++ that produces most of the output from a SQL 7.0
> data base on NT4 onto IIS on Windows 2003 Server with SQL 2000. All new
> code is being written in C# using ASP.NET and we are using forms
> authentication to control access to particular directories/applications.
> We are having a hard time figuring out how to configure the thing so that
> existing html files both a) have access controlled through ASP.NET forms
> authentication and b) render server side includes correctly. If we
> configure the htm/html files for the application on IIS to be handled by
> ssinc.dll the includes are rendered correctly, but access is not
> restricted by forms authentication. If we configure them to be handled by
> aspnet_isapi.dll we get forms authentication control, but the includes are
> ignored.
> Oddly, simply renaming a file from *.html to *.aspx with no other changes
> results in aspnet_isapi.dll handling it correctly -- providing forms
> authentication access control and also rendering includes correctly. But
> if the file name is *.htm or *.html, aspnet_isapi.dll fails to include the
> includes. It almost seems like this is a bug! I cannot, at any rate, see
> any reason why it would do this by design.
> So, in theory, we could solve the problem by just re-naming all our
> htm/html files with an aspx extension instead. Unfortunately this is not
> so easily done in practice since the old C++ .dll that creates most pages
> and fills them with stuff from the data base has hyperlinks to the *.html
> files hard coded into it all over the place. It is not impossible to
> change this, but we'd like to find a simpler way.
> Can anyone offer a suggestion for a way to resolve this problem? Is it
> simply a bug that aspnet_isapi.dll renders includes for *.aspx files but
> fails to do so for an otherwise identical files with a .htm or .html
> extension?
> All the best,
> will
> William F. Zachmann, President
> Canopus Research Inc.
> http://www.canopusresearch.com
>
Bruce,
Sounds like you have provided the specific information I needed. I will try
that out to confirm that it works. Thanks very much!
All the best,
will
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:%23CYQWpL2FHA.3568@.TK2MSFTNGP15.phx.gbl...
> asp.net processing is a two part
> 1) map file extension to asp.net dll - this enables form authenication
> 2) <@. page > directive is found, this causes the page to processed as an
> asp.net page and implements the include logic.
> you can just add the <@.page> directive to your html pages and you're good
> to go.
> -- bruce (sqlwork.com)
>
> "William F. Zachmann" <wfz@.NOcanopusresearchSPAM.com> wrote in message
> news:e9bNSyE2FHA.2540@.TK2MSFTNGP09.phx.gbl...
>
Alex,
Thanks for your intention to help however, if you read through my original
message, you will see that I have already considered the possibility of
simply re-naming the htm/html files with aspx extensions but that this is
not a very good option since the old (massive) C++ dll has many hard-coded
dependencies tied to the file (and, for that matter, directory) names. I
quite explicitly said that I was looking for another alternative.
All the best,
will
"Alex" <Alex@.discussions.microsoft.com> wrote in message
news:7CA1CE05-59A9-4107-BCAF-8675AB75E4BE@.microsoft.com...
> Will,
> how about this:
> 1. Rename your .html files to .aspx
> 2. For the .html hyperlinks generated by your DLL you write an HTTP
> Handler
> that does an URL rewrite from .html to .aspx.
> For example this is what happens when you click on
> http://www.dotnet42.com/NG_microsof...ww.DotNet42.com - The Answer to Your DotNet Question
>
> "William F. Zachmann" wrote:
>
HTML encoding of asp controls.
Say, I want to show the string "<script> alter("test") <script>". For a
"BoundColumn" used in DataGrid, I get an *real alert box* instead
of the string. In order for it to be shown correctly, I have to call
"Server.HtmlEncode" before set the text.
But if I use "asp:TextBox" control, I can not do "Server.HtmlEncode"
before I set the text. Otherwise, I will see this on my web page: "<..."
Is there a general rule, or documentation of which controls will do HTML
encoding automatically, which don't?
Thanks,
Guogang
HTML Encoding in ASP .NET 2.0 Best Practices
There currently is no HTML Encoding done anywhere. Data to the
application come from all different places such as UI, WebServices,
Remoting and listeners that log data. All this data needs to be shown
to the user at some point and all of it can include some sort of HTML.
How in the world can I make sure that this informations is displayed
properly without allowing the HTML in the Data to mess up the HTML in
the page. Of course i have to HTML Encode the information but how do i
do that?
I have tons of pages! Do i really have to go to every possible page,
looking for every possible piece of output information and
Server.HtmlEncode it? That has to be the most painful thought i could
possibly think of :)
Maybe there is a desing principle i'm missing. Maybe if i had coded my
pages in a certain technique, all the information would have to through
certain controls, or through a certain mechanism that makes sure what
needs to be encoded is encoded and what needs to be left unencoded
remains unencoded.
Any help?
Thanks,
Markwell best practice would have been to think about this at the design of the
site.
1) which data fields are html that should be displayed as html and are
certified safe.
2) which data fields have html which should be scrubbed, remove scripting,
check for dangling tokens (say a <b> with no </b> ), imbedded forms, etc.
3)which data is just raw data and should be displayed as the characts type
(input <hi>, should be displayed as <hi> ).
all data should handling should default to #3. this means no response write
without encoding, no InnerHtml without validation. most controls will do the
correct behavior if you use the Text value.
-- bruce (sqlwork.com)
"Untitled" <markoueis@.hotmail.com> wrote in message
news:1140814406.809568.287320@.j33g2000cwa.googlegroups.com...
>I currently have a web application with hundreds of pages and controls.
> There currently is no HTML Encoding done anywhere. Data to the
> application come from all different places such as UI, WebServices,
> Remoting and listeners that log data. All this data needs to be shown
> to the user at some point and all of it can include some sort of HTML.
> How in the world can I make sure that this informations is displayed
> properly without allowing the HTML in the Data to mess up the HTML in
> the page. Of course i have to HTML Encode the information but how do i
> do that?
> I have tons of pages! Do i really have to go to every possible page,
> looking for every possible piece of output information and
> Server.HtmlEncode it? That has to be the most painful thought i could
> possibly think of :)
> Maybe there is a desing principle i'm missing. Maybe if i had coded my
> pages in a certain technique, all the information would have to through
> certain controls, or through a certain mechanism that makes sure what
> needs to be encoded is encoded and what needs to be left unencoded
> remains unencoded.
> Any help?
> Thanks,
> Mark
>
HTML Encoding in ASP .NET 2.0 Best Practices
There currently is no HTML Encoding done anywhere. Data to the
application come from all different places such as UI, WebServices,
Remoting and listeners that log data. All this data needs to be shown
to the user at some point and all of it can include some sort of HTML.
How in the world can I make sure that this informations is displayed
properly without allowing the HTML in the Data to mess up the HTML in
the page. Of course i have to HTML Encode the information but how do i
do that?
I have tons of pages! Do i really have to go to every possible page,
looking for every possible piece of output information and
Server.HtmlEncode it? That has to be the most painful thought i could
possibly think of :)
Maybe there is a desing principle i'm missing. Maybe if i had coded my
pages in a certain technique, all the information would have to through
certain controls, or through a certain mechanism that makes sure what
needs to be encoded is encoded and what needs to be left unencoded
remains unencoded.
Any help?
Thanks,
Markwell best practice would have been to think about this at the design of the
site.
1) which data fields are html that should be displayed as html and are
certified safe.
2) which data fields have html which should be scrubbed, remove scripting,
check for dangling tokens (say a <b> with no </b>), imbedded forms, etc.
3)which data is just raw data and should be displayed as the characts type
(input <hi>, should be displayed as <hi>).
all data should handling should default to #3. this means no response write
without encoding, no InnerHtml without validation. most controls will do the
correct behavior if you use the Text value.
-- bruce (sqlwork.com)
"Untitled" <markoueis@.hotmail.com> wrote in message
news:1140814406.809568.287320@.j33g2000cwa.googlegr oups.com...
>I currently have a web application with hundreds of pages and controls.
> There currently is no HTML Encoding done anywhere. Data to the
> application come from all different places such as UI, WebServices,
> Remoting and listeners that log data. All this data needs to be shown
> to the user at some point and all of it can include some sort of HTML.
> How in the world can I make sure that this informations is displayed
> properly without allowing the HTML in the Data to mess up the HTML in
> the page. Of course i have to HTML Encode the information but how do i
> do that?
> I have tons of pages! Do i really have to go to every possible page,
> looking for every possible piece of output information and
> Server.HtmlEncode it? That has to be the most painful thought i could
> possibly think of :)
> Maybe there is a desing principle i'm missing. Maybe if i had coded my
> pages in a certain technique, all the information would have to through
> certain controls, or through a certain mechanism that makes sure what
> needs to be encoded is encoded and what needs to be left unencoded
> remains unencoded.
> Any help?
> Thanks,
> Mark
html encoding dynamic link?
don't know if this is the right category, but I think the question is pretty simple.
I've got a web user control wich contains an image tag. When the control loads, I want to set the ImageUrl property to something like this:
"~/WUC/ShowLogo.aspx?id=" + PartnerID + @dotnet.itags.org."&sz=" + Size
This page just takes the id and the given size and outputs a thumbnail from an image in the database.
Now the image doesn't show up. When I check the source of the rendered html page I see this:
<img id="ctl00_cph_pcMain_imgLogo" src="http://pics.10026.com/?src=WUC/ShowLogo.aspx?id=1&sz=75" style="border-width:0px;"/
pretty obvious where everything goes wrong.. It encodes the & tot & wich is not really a valid url..
My question: How do I stop the component, or prolly the page the component is on, from encoding the url?
Not sure what goes worng, it shouldn't encode it by default behaviour.
imgLogo.ImageURL = "/WUC/ShowLogo.aspx?id=" + PartnerID + "&sz=" + Size;
should work fine.
Can you show us the piece of code where you set the imageURL property ?
you're right, it shouldn't encode, I have no freaking idea why it won't..
code behind:
protected void Page_Load(object sender, EventArgs e)
{
imgLogo.ImageUrl = "~/WUC/ShowLogo.aspx?id=" + PartnerID + "&sz=" + Size;
lblTitle.Text = Title;
lnkInfo.NavigateUrl = @."~/Info.aspx?id=" + PartnerID;
}
page:
<table>
<tr>
<td><asp:Image runat="server" ID="imgLogo" /></td>
<td>
<asp:Label runat="server" ID="lblTitle" />
<br />
<asp:HyperLink runat="server" ID="lnkInfo">meer <asp:Image runat="server" ID="imgArrow" ImageUrl="~/media/images/doublearrow.gif" /></asp:HyperLink>
</td>
</tr>
</table
anyone got a clue?
Saturday, March 24, 2012
html encoding
I know it would work if i encode it by replaceing "<" to "<"
How about double quote charater ( " )?
The below line is giving errors because of it.
<add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/>
Please help
MirajDon't use ", it will work with '.
"Miraj Haq" wrote:
> I want to save an html tag in web.config,
> I know it would work if i encode it by replaceing "<" to "<"
> How about double quote charater ( " )?
> The below line is giving errors because of it.
> <add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/>
> Please help
> Miraj
>
>
> I want to save an html tag in web.config,
> I know it would work if i encode it by replaceing "<" to "<"
> How about double quote charater ( " )?
Escape it as " as per the XML specification. So, you'd have:
<add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">" />
[not sure why you had a pair of double quotes at the very end...]
html encoding
I know it would work if i encode it by replaceing "<" to "<"
How about double quote charater ( " )?
The below line is giving errors because of it.
<add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/
Please help
MirajDon't use ", it will work with '.
"Miraj Haq" wrote:
> I want to save an html tag in web.config,
> I know it would work if i encode it by replaceing "<" to "<"
> How about double quote charater ( " )?
> The below line is giving errors because of it.
> <add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/>
> Please help
> Miraj
>
> I want to save an html tag in web.config,
> I know it would work if i encode it by replaceing "<" to "<"
> How about double quote charater ( " )?
Escape it as " as per the XML specification. So, you'd have:
<add key="myHTML" value="<img src="host.jpg">" /
[not sure why you had a pair of double quotes at the very end...]
HTML Email Help
I have been using the contents of each textbox so that the email can display details of a specific order. For example, txtForename.text, which could contain "Jerry".
I have been trying many different ways to rectify the error, with now luck.
My code looks like this:
' Send Email to customer
Dim Mail As New MailMessage()
Mail.To = lblEmail.text
Mail.From = "rentals@dotnet.itags.org.OCR.com"
Mail.Subject = "Rental Details"
Mail.BodyFormat = MailFormat.Html
Mail.Body = "<h1>Rental Summary</h1><hr /><table width='100%'><tr><td colspan='2'><h2><u>Personal Details</u></h2></td></tr><tr><td></td><td></td></tr>" & _
"<tr><td width='9%'><b>Name:</b></td><td width='91%'>" & lblForename.text & lblSurname.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Address:</b></td><td>"& lblAddress1.text &"</td>" & _
"</tr><tr><td></td><td>"& lblAddress2.text & "</td></tr><tr><td></td><td>" & lblCounty.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Post Code:</b> </td><td>" & lblPostcode.text & "</td>" & _
"</tr><tr><td></td><td></td></tr><tr><td><b>Tel No:</b></td><td>" & lblTelNo.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Email Address:</b> </td>" & _
"<td>" & lblEmail.text & "</td></tr><tr><td></td><td></td></tr></table><br /><table width='100%'><tr><td colspan='2'><h2><u>Purchase Information</u></h2></td>" & _
"</tr><tr><td width='10%'></td><td width='90%'></td></tr><tr><td><b>Car:</b></td><td>" & lblCarModel.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Price:</b></td>" & _
"<td>" & lblCarPrice.text & "</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td><b>Accessory Name:</b></td><td>" & lblAccessoryName.text & "</td></tr><tr><td><b>Price:</b></td>" & _
"<td>" & lblAccessoryPrice.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Pickup Date:</b></td><td>" & lblCollectDate.text & "</td></tr><tr><td></td><td></td></tr><tr><td><b>Return Date:</b></td>" & _
"<td>" & lblReturnDate.text & "</td></tr></table><br />"
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(Mail)
I have created the email in a table format as you can see. I don't think there is any errors in the email structure. However, I am getting the following error:
Server Error in '/' Application.
The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for someone@dotnet.itags.org.hotmail.com
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:System.Runtime.InteropServices.COMException: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for someone@dotnet.itags.org.hotmail.com
Source Error:
Line 153: "<td>" & lblReturnDate.text & "</td></tr></table><br />"
Line 154: SmtpMail.SmtpServer = "localhost"
Line 155: SmtpMail.Send(Mail)
Line 156:
Line 157: Response.Redirect("RecordProcess.aspx")
I would appreciate any help anyone could give me!
You need to pass username/pass to your SMTP or adjust the SMTP to allow your access.
There was a post yesterday with the exact syntax for passing the credentials, but basically that's all it is.
Thats great thanks for your help!
I will try it out!
HTML Email
I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
in the body of the email, but it didn't work. MY html tags became text.
What can I do?Hi,
You need to set the
Mail.BodyFormat = MailFormat.Html
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> How do I send HTML email with the System.Web.Mail namespace?
> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
> in the body of the email, but it didn't work. MY html tags became text.
> What can I do?
>You need to set the
>Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
>(Assuming Mail is the name of your mail object).
>Best regards,
>Dave Colliver.
>http://www.ManchesterFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>
>"Arne" <Arne@.discussions.microsoft.com> wrote in message
>news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>
Alan Silver
(anything added below this line is nothing to do with me)
Yes it does.
"Alan Silver" wrote:
> Do you know if it can handle multi-part e-mails? What I mean is ones
> sent in both plain text and HTML. That way, the e-mail client being used
> can display whichever it feels (or the user has specified).
> Thanks.
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
> OK, maybe I should have been a bit more specific with my question!!
> *How* do you do these types of e-mails? I couldn't see anything in the
> SDK - which doesn't mean it's not there, just that I couldn't find it.
> TIA
>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>
>Mail.BodyFormat = MailFormat.Html
>will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>No, the documentation will not tell you everything you need to know about
>email.
>"Alan Silver" wrote:
>
Alan Silver
(anything added below this line is nothing to do with me)
HTML Email
I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
in the body of the email, but it didn't work. MY html tags became text.
What can I do?Hi,
You need to set the
Mail.BodyFormat = MailFormat.Html
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.com> wrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> How do I send HTML email with the System.Web.Mail namespace?
> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
> in the body of the email, but it didn't work. MY html tags became text.
> What can I do?
>You need to set the
>Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
>(Assuming Mail is the name of your mail object).
>Best regards,
>Dave Colliver.
>http://www.ManchesterFOCUS.com
>~~
>http://www.FOCUSPortals.com - Local franchises available
>
>"Arne" <Arne@.discussions.microsoft.com> wrote in message
>news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> How do I send HTML email with the System.Web.Mail namespace?
>> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
>> in the body of the email, but it didn't work. MY html tags became text.
>>
>> What can I do?
--
Alan Silver
(anything added below this line is nothing to do with me)
Yes it does.
"Alan Silver" wrote:
> >You need to set the
> >Mail.BodyFormat = MailFormat.Html
> Do you know if it can handle multi-part e-mails? What I mean is ones
> sent in both plain text and HTML. That way, the e-mail client being used
> can display whichever it feels (or the user has specified).
> Thanks.
> >(Assuming Mail is the name of your mail object).
> >Best regards,
> >Dave Colliver.
> >http://www.ManchesterFOCUS.com
> >~~
> >http://www.FOCUSPortals.com - Local franchises available
> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> >> How do I send HTML email with the System.Web.Mail namespace?
> >> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
> >> in the body of the email, but it didn't work. MY html tags became text.
> >>
> >> What can I do?
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
>"Alan Silver" wrote:
>> >You need to set the
>>> >Mail.BodyFormat = MailFormat.Html
>>
>> Do you know if it can handle multi-part e-mails? What I mean is ones
>> sent in both plain text and HTML. That way, the e-mail client being used
>> can display whichever it feels (or the user has specified).
>>
>> Thanks.
>>
>> >(Assuming Mail is the name of your mail object).
>>> >Best regards,
>> >Dave Colliver.
>> >http://www.ManchesterFOCUS.com
>> >~~
>> >http://www.FOCUSPortals.com - Local franchises available
>>>> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
>> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> >> How do I send HTML email with the System.Web.Mail namespace?
>> >> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
>> >> in the body of the email, but it didn't work. MY html tags became text.
>> >>
>> >> What can I do?
>>>>
>> --
>> Alan Silver
>> (anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
> >Yes it does.
> OK, maybe I should have been a bit more specific with my question!!
> *How* do you do these types of e-mails? I couldn't see anything in the
> SDK - which doesn't mean it's not there, just that I couldn't find it.
> TIA
> >"Alan Silver" wrote:
> >> >You need to set the
> >> >> >Mail.BodyFormat = MailFormat.Html
> >>
> >> Do you know if it can handle multi-part e-mails? What I mean is ones
> >> sent in both plain text and HTML. That way, the e-mail client being used
> >> can display whichever it feels (or the user has specified).
> >>
> >> Thanks.
> >>
> >> >(Assuming Mail is the name of your mail object).
> >> >> >Best regards,
> >> >Dave Colliver.
> >> >http://www.ManchesterFOCUS.com
> >> >~~
> >> >http://www.FOCUSPortals.com - Local franchises available
> >> >> >> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
> >> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
> >> >> How do I send HTML email with the System.Web.Mail namespace?
> >> >> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
> >> >> in the body of the email, but it didn't work. MY html tags became text.
> >> >>
> >> >> What can I do?
> >> >> >>
> >> --
> >> Alan Silver
> >> (anything added below this line is nothing to do with me)
> >>
> --
> Alan Silver
> (anything added below this line is nothing to do with me)
>Mail.BodyFormat = MailFormat.Html
>will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>No, the documentation will not tell you everything you need to know about
>email.
>"Alan Silver" wrote:
>> >Yes it does.
>>
>> OK, maybe I should have been a bit more specific with my question!!
>>
>> *How* do you do these types of e-mails? I couldn't see anything in the
>> SDK - which doesn't mean it's not there, just that I couldn't find it.
>>
>> TIA
>>
>> >"Alan Silver" wrote:
>>> >> >You need to set the
>> >>> >> >Mail.BodyFormat = MailFormat.Html
>> >>
>> >> Do you know if it can handle multi-part e-mails? What I mean is ones
>> >> sent in both plain text and HTML. That way, the e-mail client being used
>> >> can display whichever it feels (or the user has specified).
>> >>
>> >> Thanks.
>> >>
>> >> >(Assuming Mail is the name of your mail object).
>> >>> >> >Best regards,
>> >> >Dave Colliver.
>> >> >http://www.ManchesterFOCUS.com
>> >> >~~
>> >> >http://www.FOCUSPortals.com - Local franchises available
>> >>> >>> >> >"Arne" <Arne@.discussions.microsoft.com> wrote in message
>> >> >news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
>> >> >> How do I send HTML email with the System.Web.Mail namespace?
>> >> >> I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
>> >> >> in the body of the email, but it didn't work. MY html tags became text.
>> >> >>
>> >> >> What can I do?
>> >>> >>> >>
>> >> --
>> >> Alan Silver
>> >> (anything added below this line is nothing to do with me)
>> >>
>>
>> --
>> Alan Silver
>> (anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
thanks everyone for the replies.
"Alan Silver" wrote:
Quote:
Originally Posted by
Quote:
Originally Posted by
Mail.BodyFormat = MailFormat.Html
will send both text and HTML format in the same format.
Thanks. How do I set the two body texts? I would want a plain text one
and an HTML one. AFAICS, there is only the one Body property, which
presumably uses the MailFormat property to decide how to display the
contents. I can't see how you do multi-part messages.
Thanks
>
Quote:
Originally Posted by
No, the documentation will not tell you everything you need to know about
email.
"Alan Silver" wrote:
Quote:
Originally Posted by
Yes it does.
OK, maybe I should have been a bit more specific with my question!!
*How* do you do these types of e-mails? I couldn't see anything in the
SDK - which doesn't mean it's not there, just that I couldn't find it.
TIA
"Alan Silver" wrote:
You need to set the
Mail.BodyFormat = MailFormat.Html
Do you know if it can handle multi-part e-mails? What I mean is ones
sent in both plain text and HTML. That way, the e-mail client being used
can display whichever it feels (or the user has specified).
Thanks.
(Assuming Mail is the name of your mail object).
Best regards,
Dave Colliver.
http://www.ManchesterFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
"Arne" <Arne@.discussions.microsoft.comwrote in message
news:5057523D-B7BA-4121-A9DD-3E6EBC303632@.microsoft.com...
How do I send HTML email with the System.Web.Mail namespace?
I tried to put <HTML><HEAD></HEAD><BODY><b>Test</b></BODY></HTML>
in the body of the email, but it didn't work. MY html tags became text.
What can I do?
--
Alan Silver
(anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
>
--
Alan Silver
(anything added below this line is nothing to do with me)
>
HTML Elements and Web Control Elements ...
my email page code looks like this:-
===========================
you can set an html textbox value the same way you did in ASP.Sub Page_load(Sender as Object, E as EventArgs)
textbox1.text = cstr(session("emailAddress")) 'this works fine
request.form("EmailAddress") = cstr(session("emailAddress")) 'not working :(
If request.form("EmailAddress") = "" Then
dim strResponse as string = "<h2>Send Email using ASP.NET formatted in HTML</h2>"
lblMessage.Text = strResponse
Else
dim strResponse as string = "You just sent an email message formatted in HTML to:<h2>" & request("EmailAddress") & "</h2>"
lblMessage.Text = strResponse
End IfEnd Sub
Sub btn_Click(sender as Object, e as System.EventArgs)
If request.form("EmailAddress") <> ""
Dim mail As New MailMessage
mail.From = "email@dotnet.itags.org.yahoo.com"
mail.To = request.form("EmailAddress")
mail.Subject = "Message sent using ASP.NET and CDONTS"
mail.Body = "HTML Message sent from ASPFree.com using ASP.NET and Cdonts" & "<a href=http://aspfree.com/aspnet/email.aspx>Wonder how this is done?</a>" & "<a href=http://aspfree.com/aspnet/setupcdonts.aspx>Wonder How to setup CDONTS?</a>"
mail.BodyFormat = MailFormat.Html
SmtpMail.SmtpServer = "19.204.22.166"
SmtpMail.Send(mail)
End If
End Sub
<input type="textbox" value="<%=Session("emailaddress")%"
the server controls give you a great deal of flexibility when building a web page. The code behind makes programming a web page more like programming a windows form. each server control does have overhead however, so if you dont need the extra functionality provided by making the control a runat=server, then you should stick to regular HTML elements.
html editor for update pages contents
I develop a Web site ASP.NET which contains dynamic pages (example: News .).
I would want that the administrator of site can add and update contents in
these pages with formatting options (example: colors, fonts.); I believe
that the solution is a small html editor.
Somebody could help me or show me how to make?
Quite other idea will be welcome.
Thank you in advance.
NoroHi Noro,
You might want to check out the free editor that comes with DotNetNuke:
http://www.dotnetnuke.com/
Ken
Microsoft MVP [ASP.NET]
"Noro" <noureddine@.astoine.com> wrote in message
news:%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro
>
html editor for update pages contents
I develop a Web site ASP.NET which contains dynamic pages (example: News .).
I would want that the administrator of site can add and update contents in
these pages with formatting options (example: colors, fonts.); I believe
that the solution is a small html editor.
Somebody could help me or show me how to make?
Quite other idea will be welcome.
Thank you in advance.
NoroJust a remark: My idea is to integrate the html editor into the
administration interface of the site.
Thank you in advance,
Noro
"Noro" <noureddine@.astoine.com> a crit dans le message de news:
%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro
Hi Noro,
You might want to check out the free editor that comes with DotNetNuke:
http://www.dotnetnuke.com/
Ken
Microsoft MVP [ASP.NET]
"Noro" <noureddine@.astoine.com> wrote in message
news:%23eWu7VWhGHA.3572@.TK2MSFTNGP04.phx.gbl...
> Hello,
> I develop a Web site ASP.NET which contains dynamic pages (example: News
> .). I would want that the administrator of site can add and update
> contents in these pages with formatting options (example: colors, fonts.);
> I believe that the solution is a small html editor.
> Somebody could help me or show me how to make?
> Quite other idea will be welcome.
>
> Thank you in advance.
> Noro