| | |
Email Web Page Content
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2006
Posts: 6
Reputation:
Solved Threads: 0
Hi all,
I hav an application running in ASP.Net using VB. I hav two textboxes which carries user's input and a button. On Click of this button, the values in the textboxes will be added and be displayed in a label in a new window. I hav declared a variable to carry the result and display it in the label. Now, in the new window i hav a button to email the page content and the result label which is in a panel. I'm using the below code to email the new window content.
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim SB As New StringBuilder()
Dim sw As New StringWriter(SB)
Dim htmlTW As New HtmlTextWriter(sw)
Label1.RenderControl(htmlTW)
Dim printlabel As String = SB.ToString()
'create the mail message
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress("mysathia@streamyx.com")
mail.To.Add("sathia.m@dotw.com")
mail.IsBodyHtml = True
'set the content
mail.Subject = "Test Message"
mail.Body = printlabel
'send the message
Dim smtp As New SmtpClient("smtp.tm.net.my")
smtp.Send(mail)
Response.Write("Message Sent")
End Sub
Query: When I email the new window, i can only get the result label displayed. I want the result label to be displayed with the panel. Can anyone help me on this.
I hav an application running in ASP.Net using VB. I hav two textboxes which carries user's input and a button. On Click of this button, the values in the textboxes will be added and be displayed in a label in a new window. I hav declared a variable to carry the result and display it in the label. Now, in the new window i hav a button to email the page content and the result label which is in a panel. I'm using the below code to email the new window content.
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim SB As New StringBuilder()
Dim sw As New StringWriter(SB)
Dim htmlTW As New HtmlTextWriter(sw)
Label1.RenderControl(htmlTW)
Dim printlabel As String = SB.ToString()
'create the mail message
Dim mail As New MailMessage()
'set the addresses
mail.From = New MailAddress("mysathia@streamyx.com")
mail.To.Add("sathia.m@dotw.com")
mail.IsBodyHtml = True
'set the content
mail.Subject = "Test Message"
mail.Body = printlabel
'send the message
Dim smtp As New SmtpClient("smtp.tm.net.my")
smtp.Send(mail)
Response.Write("Message Sent")
End Sub
Query: When I email the new window, i can only get the result label displayed. I want the result label to be displayed with the panel. Can anyone help me on this.
![]() |
Similar Threads
- Email an aspx page (or any webpage you want) (ASP.NET)
- how do i write the code for taking out a hard copy of the web page (HTML and CSS)
- Read a web page and write the contents to a file (ASP)
- Web page in email (JavaScript / DHTML / AJAX)
- Unique Articles and Web Content. (Post your Resume)
- Change Web Page Font Size on the Fly (Windows tips 'n' tweaks)
- How to create a web page with scrolling menus to specific entries (HTML and CSS)
Other Threads in the ASP.NET Forum
- Previous Thread: Problem with javascript variable and hidden input
- Next Thread: Cross-Page PostBack with grouped RadioButtons
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 3.5 ajax appliances application asp asp.net beginner box browser businesslogiclayer button c# cac checkbox child class compatible complex content contenttype control countryselector courier database datagrid datagridview datalist deployment development dgv dialog dropdown dropdownmenu dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash flv folder form gridview gudi iis image javascript languages list maps menu mobile mssql nameisnotdeclared novell opera order parent problem ratings redirect refer registration relationaldatabases reportemail response.redirect rows search security select serializesmo.table sessionvariables silverlight smoobjects software sql ssl tracking treeview typeof validatedate validation vb.net vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming wizard xsl





