473,394 Members | 1,703 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,394 software developers and data experts.

File System Object and displaying data

Hello All

I used to have some static htm files which used to display data. There is a
calling asp file which used to do something like below

if Request.QueryString("PageName").count = 0 then
strPageNameHtm = "toc.htm"
strPageNameInc = "toc.inc"
else
strPageNameHtm = Request.QueryString("PageName") & ".htm"
strPageNameInc = Request.QueryString("PageName") & ".inc"
end if
strPageNameHtm = server.mapPath(strPageNameHtm)

strPageNameInc = server.mapPath(strPageNameInc)
'response.write(strPageNameHtm)
set fs = server.createobject("scripting.fileSystemObject")
set f = fs.openTextFile(strPageNameHtm)
strSPDHtml = f.readall
The strSPDHTML info used to be displayed using a response.write(strSPDHTML).
This allowed the static content to be loaded up.

I switched the static pages to be asp pages having the content come from a
database. I would still like to maintain the controlling page logic. Can I
modify the above section of code in anyways to access the asp page content

Nov 2 '06 #1
1 1043

"Rahul Chatterjee" <ra***@benesysinc.comwrote in message
news:OO**************@TK2MSFTNGP04.phx.gbl...
Hello All

I used to have some static htm files which used to display data. There is
a
calling asp file which used to do something like below

if Request.QueryString("PageName").count = 0 then
strPageNameHtm = "toc.htm"
strPageNameInc = "toc.inc"
else
strPageNameHtm = Request.QueryString("PageName") & ".htm"
strPageNameInc = Request.QueryString("PageName") & ".inc"
end if
strPageNameHtm = server.mapPath(strPageNameHtm)

strPageNameInc = server.mapPath(strPageNameInc)
'response.write(strPageNameHtm)
set fs = server.createobject("scripting.fileSystemObject")
set f = fs.openTextFile(strPageNameHtm)
strSPDHtml = f.readall
The strSPDHTML info used to be displayed using a
response.write(strSPDHTML).
This allowed the static content to be loaded up.

I switched the static pages to be asp pages having the content come from a
database. I would still like to maintain the controlling page logic. Can
I
modify the above section of code in anyways to access the asp page content
Sounds like you are looking for this:-

if Request.QueryString("PageName").count = 0 then
strPageName = "toc.asp"
else
strPageName = Request.QueryString("PageName") & ".asp"
end if
Server.Execute strPageName
end if

You should be aware however that this can allow a client to bypass some
forms of security. E.g a sub folder of ASPs may have anonymous user turned
off or IP range restrictions but the above page could allow an external user
to execute these pages.

Nov 7 '06 #2

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

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
5
by: Drew Yallop | last post by:
I read an XML file with a stream reader in VB.Net. When I look at the stream reader output in debug mode (by passing cursor over the stream reader object)the format is a perfect replica of the...
8
by: Sam Collett | last post by:
Is there a basic guide on Xml document creation and editing (simpler than the MSDN docs). Say I want to create a file containing the following: <?xml version="1.0" encoding="utf-8"...
0
by: Steve Chatham | last post by:
I am stuck on this. It ought to be a simple reason as to why this is problematic, in that it works on smaller groups of data (say under 40 records), but doesn't on larger groups of records (40+)....
1
by: David Elliott | last post by:
As I am new to ASP.Net, I am looking for some insight on how to solve this issue. I have a main page that loads a custom control. The custom control has a DataList object. The DataSource is set...
2
by: Mad Scientist Jr | last post by:
i'm trying to read a file byte by byte (and later alter the data and write it to a 2nd file byte by byte) and running into a problem where it seems to keep reading the same byte over and over again...
1
by: KMZ_state | last post by:
We have a debate here. We are receiving a CSV file specified by the user and need to validate the contents, writing the "good" records to the database and displaying the "bad" records to the user....
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
3
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.