473,626 Members | 3,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.asp x")
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 4502
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********@nos pam.nospam> wrote in message
news:uC******** ******@TK2MSFTN GP12.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.asp x")
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********@nos pam.nospam> wrote in message
news:OI******** ******@TK2MSFTN GP14.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********@nos pam.nospam> wrote in message
news:uC******** ******@TK2MSFTN GP12.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.asp x")
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
5696
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." Here's a little session in Python's interactive window >>> f=open('mytext.txt','w+') >>> f.write('My name is Bob') >>> s=f.read()
0
2966
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 entered. When this button is pressed and extract is prduced and IE's standard Open/Save dialog should popup so they can navigate to the directory to save the extract in, or if they want, they can choose to open and view the extract without saving it. ...
2
4230
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: ---------------------------------------------------------- Exception from HRESULT: 0xC004800A Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and...
5
2161
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 be able to save my work in a file with custom file extention (similar to *.PSD in photoshop) 2) After I save my work, if I double click on that file, my work should be opened with my application automatically and I need to be able to work on
14
19750
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
12595
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 $line; fclose($fp); coding is not problem, The problem is file modifier as mention in PHP
6
6135
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? I tried using javascript, however, I am not able to make javascript wait for the page to completely load, before trying to access and fill fields on the page. Hence resorted to .net, but not finding the right library to use.
13
3541
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 some javascript code that calls window.open. I pass the resource url of page B to Page A's window.open call. Page B is then loaded and executed but none of the server-side code is rendered. If I view the source of the page, the code (and page...
7
4002
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(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
0
8262
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8364
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6122
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.