473,394 Members | 1,709 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.

Open and read/write ASPX file

Howdy,

Trying to open and read/write another aspx file from my aspx page. Basically
I want to be able to update my aspx files from the website. Here's my code
so far:

Dim path As String = Server.MapPath("tester.aspx")
Dim din As New StreamReader(IO.File.OpenRead(path))
Dim conts As String = din.ReadToEnd

txtEdit.Text = conts

But it doesn't work. If I use a text file, it works great, but not an ASPX
file. I'm assuming they're protected? How do I get them open?

Thanks!!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Nov 25 '05 #1
2 4494
Don't laugh too hard, but it works fine. My first attempt at this script I
accidently selected OpenWrite which cleared the file. Then when reading a
blank file, I got nothing back.

I recreated the file with content and it works great now.

Thanks!!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com

"David Lozzi" <Da********@nospam.nospam> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
Howdy,

Trying to open and read/write another aspx file from my aspx page.
Basically I want to be able to update my aspx files from the website.
Here's my code so far:

Dim path As String = Server.MapPath("tester.aspx")
Dim din As New StreamReader(IO.File.OpenRead(path))
Dim conts As String = din.ReadToEnd

txtEdit.Text = conts

But it doesn't work. If I use a text file, it works great, but not an ASPX
file. I'm assuming they're protected? How do I get them open?

Thanks!!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com

Nov 25 '05 #2
Thanks for telling us what works! <grin>

"David Lozzi" <Da********@nospam.nospam> wrote in message
news:OI**************@TK2MSFTNGP14.phx.gbl...
Don't laugh too hard, but it works fine. My first attempt at this script I
accidently selected OpenWrite which cleared the file. Then when reading a
blank file, I got nothing back.

I recreated the file with content and it works great now.

Thanks!!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com

"David Lozzi" <Da********@nospam.nospam> wrote in message
news:uC**************@TK2MSFTNGP12.phx.gbl...
Howdy,

Trying to open and read/write another aspx file from my aspx page.
Basically I want to be able to update my aspx files from the website.
Here's my code so far:

Dim path As String = Server.MapPath("tester.aspx")
Dim din As New StreamReader(IO.File.OpenRead(path))
Dim conts As String = din.ReadToEnd

txtEdit.Text = conts

But it doesn't work. If I use a text file, it works great, but not an
ASPX file. I'm assuming they're protected? How do I get them open?

Thanks!!

--
David Lozzi
Web Applications Developer
dlozzi@(remove-this)delphi-ts.com


Nov 26 '05 #3

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

Similar topics

6
by: Alex | last post by:
Rossum's tutorial on Python states: "open() returns a file object, and is most commonly used with two arguments: 'open(filename, mode)' mode 'r+' opens the file for both reading and writing." ...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
2
by: Seok Bee | last post by:
Dear Experts, In my web application, I am having a button to open a file located in the server. When I click on the button to view the file, I received the following error message:...
5
by: Yoshitha | last post by:
Hi I am developing a C#.Net windows application for my project. In that project I have an IDE to work on. The application is similar to Adobe Photoshop. My requirement is as follows. 1) I must...
14
by: Rochester | last post by:
Hi, I just found out that the general open file mechanism doesn't work for named pipes (fifo). Say I wrote something like this and it simply hangs python: #!/usr/bin/python import os
2
by: agphoto | last post by:
There is big or problem in open file in read and write mode.. $file = "data.txt"; $fp = fopen($file,"w+"); $line = fgets($fp,"120"); // i need only 1st line to read and upto 120 bytes echo...
6
by: =?Utf-8?B?U2FtZWVrc2hh?= | last post by:
Hi, I want to write a simple .net program to open a URL, fill in fields, and click on a button to submit it using .net 1.1 framework. Can someone help in suggesting the libraries I should use?...
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...
7
by: Peter | last post by:
ASP.NET 2.0 I am trying to open a Word document and Excel document from a dialog web page, what's the best way to do that? I have tried the following: Response.Clear();...
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:
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: 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...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.