473,386 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

embed HTML table using VB

I am showing a table in a web page, I need help to email this table,
please any sugestion ....? thanks!!

Oct 5 '06 #1
3 2716
Sending html emails is as simple as the code below:

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "blah";
msgMail.Cc = "blah blah";
msgMail.From = "blah";
msgMail.Subject = "the subject text";

msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><b>Hello World</b>" + " <font
color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;

SmtpMail.Send(msgMail);

%>

If your table however is within an asp.net page you'll have to acquire it as
a string that can be included as the html body of the mail. I would suggest
you take a read of this little snippet by Rick Strahl that explians
capturing output from a rendered web page.

http://www.johntimney.com/home/redir...posts/481.aspx

You'll then need to work out how to pick out your table if thats all you
require.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com

"Aur_Ros" <au*****@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I am showing a table in a web page, I need help to email this table,
please any sugestion ....? thanks!!

Oct 5 '06 #2
thanks a lot John!!, yes that is what I need to do, I need to Know how
to get HTML code of that table created dynamically in the web page !!

John Timney (MVP) wrote:
Sending html emails is as simple as the code below:

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "blah";
msgMail.Cc = "blah blah";
msgMail.From = "blah";
msgMail.Subject = "the subject text";

msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><b>Hello World</b>" + " <font
color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;

SmtpMail.Send(msgMail);

%>

If your table however is within an asp.net page you'll have to acquire it as
a string that can be included as the html body of the mail. I would suggest
you take a read of this little snippet by Rick Strahl that explians
capturing output from a rendered web page.

http://www.johntimney.com/home/redir...posts/481.aspx

You'll then need to work out how to pick out your table if thats all you
require.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com

"Aur_Ros" <au*****@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I am showing a table in a web page, I need help to email this table,
please any sugestion ....? thanks!!
Oct 5 '06 #3
The easiest way is usually to mark the table, by surrounding it with custom
tags !<--tablestarts-!<--tableends- then crop the string captured in the
render event using ther .net string methods.

or if yor doing it client side then wrap your table with a specific div
identifier and use javascripts innerHTML method and then post it to a page
that will invoke your mail method.

<div id= "myTable">This is my table.</div>

something like : document.getElementId("myTable").innerHTML .

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Aur_Ros" <au*****@hotmail.comwrote in message
news:11**********************@c28g2000cwb.googlegr oups.com...
thanks a lot John!!, yes that is what I need to do, I need to Know how
to get HTML code of that table created dynamically in the web page !!

John Timney (MVP) wrote:
>Sending html emails is as simple as the code below:

<% @Page Language="C#" %>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = "blah";
msgMail.Cc = "blah blah";
msgMail.From = "blah";
msgMail.Subject = "the subject text";

msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><b>Hello World</b>" + " <font
color=\"red\">ASP.NET</font></body></html>";
msgMail.Body = strBody;

SmtpMail.Send(msgMail);

%>

If your table however is within an asp.net page you'll have to acquire it
as
a string that can be included as the html body of the mail. I would
suggest
you take a read of this little snippet by Rick Strahl that explians
capturing output from a rendered web page.

http://www.johntimney.com/home/redir...posts/481.aspx

You'll then need to work out how to pick out your table if thats all you
require.

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com

"Aur_Ros" <au*****@hotmail.comwrote in message
news:11**********************@b28g2000cwb.googleg roups.com...
I am showing a table in a web page, I need help to email this table,
please any sugestion ....? thanks!!

Oct 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Anna | last post by:
Hi all. I want to embed the EMBED tag in the object tag. I understood that I need to provide a PARAM tag inside the OBJECT whose value will hold the content of EMBED src attribute, but after...
4
by: AES/newspost | last post by:
Can anyone provide a quick tip on the html structure to link from a thumb to a movie poster and from there on to a QuickTime movie, all in one go, using EMBED? I have a number of (large)...
4
by: Pawel | last post by:
Hello All I tried to embed Excel sheet into HTML page by following command: <iframe src="Tmp.XLS" width="100%" height="500"></iframe> and it works, showing Excel sheet inside the page, but...
1
by: Andrew Poulos | last post by:
With "normal" SWF HTML there's an EMBED tag nested within an OBJECT tag. How can I check which tag is actually displaying the SWF? I'm using CSS on them and the style on the OBJECT affects the...
4
by: csgraham74 | last post by:
Ok - i was wondering if someone could help me. im basically trying to embed an html string in piece of XML. i created an xsl and added the CDATA into the xml around the html i wish to render....
13
by: windsorben | last post by:
I have some javascript that checks whether or not an answer is correct. It was working fine when the question was asked with text but now that I'm asking the question with audio, the javascript no...
1
by: Kaysetoaster | last post by:
Hi Coding-Gurus :) I hope you can help me:) I'm trying to embed my VB.NET usercontrol into a HTML document. I builded one that returns some HTML code. When I call it on the body's event...
3
by: helraizer1 | last post by:
I have this code in JS function show_player() { document.mediaplayer1.style.visibility = "visible"; } function content(p, clip) { var mus = document.getElementById('music'); ...
2
dream party
by: dream party | last post by:
Inserting a Flash (SWF, FLV) file into HTML web page is already an old and familiar thing to all of us. It is a rather non-flexible thing that just to edit some options in the template. However, I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.