473,386 Members | 1,621 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.

include file in server side aspx

I have a simple asp.net vb send mail page.

The mail addresses are pulled form a database and the code works well.
I want to be able to add the content of an html file to a string for the body of the email.
Later I will use some controls which will allow the user to pick what html file to use to the body of the email.
I could not find any way to do such a simple thing.
I could use <!--# include file =...-> in asp.

Help is appreciated
Aug 29 '07 #1
2 1495
dip_developer
648 Expert 512MB
I have a simple asp.net vb send mail page.

The mail addresses are pulled form a database and the code works well.
I want to be able to add the content of an html file to a string for the body of the email.
Later I will use some controls which will allow the user to pick what html file to use to the body of the email.
I could not find any way to do such a simple thing.
I could use <!--# include file =...-> in asp.

Help is appreciated
see this link...hope it will hwlp you

HTML screen scrapping
Aug 30 '07 #2
Thank you for your reply.

I works like a charm.

I found a better example though:

Dim strURL As String = "http://www.thescripts.com"
Dim objWebRequest As System.Net.HttpWebRequest
Dim objWebResponse As System.Net.HttpWebResponse
Dim streamReader As System.IO.StreamReader
Dim strHTML As String

objWebRequest = CType(System.Net.WebRequest.Create(strURL), System.Net.HttpWebRequest)
objWebRequest.Method = "GET"
objWebResponse = CType(objWebRequest.GetResponse(), System.Net.HttpWebResponse)

streamReader = New System.IO.StreamReader(objWebResponse.GetResponseS tream)

strHTML = streamReader.ReadToEnd
txtResponse.Text = strHTML
lblResponse.Text = strHTML

streamReader.Close()
objWebResponse.Close()
objWebRequest.Abort()

There is a single note to make. The page containing the code to be added to the server side must be .asp or aspx.HTM extension obviously would not work.
Aug 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Carolyn Speakman | last post by:
is it in any way possible to include a file specified by a variable name? Thanks, Carolyn
1
by: Sameer | last post by:
I have two C# aspx pages( base.aspx and newfile.aspx 1. newfile.aspx only contain ======================= < Response.Write(Session) % =======================
8
by: Alex | last post by:
Hi, I have noticed that in an aspx page <!--#include virtual="Home.htm"--> acts the same as <!--#include File="Home.htm"--> when I am NOT in the root diectory of the site (I am aware that...
4
by: Tom | last post by:
Hi, I installed .NET Framework Version 1.1 Redistributable Package and installed on Windows 2000 server. I created a aspx page which has some server control like asp:label, asp:textbox,...
4
by: Marcel Balcarek | last post by:
I am converting an ASP page to ASP .NET. The original has the following: #INCLUDE FILE="logAction.asp" The included file holds some commonly used methods. When I rename it to aspx files and...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
3
by: Larry | last post by:
Hi, I need a method to dynamically include a server side include in my asp.net page. The problem is, the include file contains asp.net controls, and I can't find a way to get the controls to...
10
by: Eric | last post by:
Hello, I have some server side includes on a Classic asp page that look something like: <!-- #include virtual="/includes/file1.asp"--> <!-- #include virtual="/includes/file2.asp" --> <!--...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.