Trying to open and read/write another aspx file from my aspx page

Discussion in 'ASP.NET 2.0' started by Bruce, Sep 4, 2007.

  1. Bruce

    Bruce DiscountASP.NET Staff

  2. hello sir,

    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!!

    Post Edited By Moderator (mjp [DASP]) : 11/2/2007 9:03:10 PM GMT
     

Share This Page