I'm using the SYSTEM.IO namespace to change the content of a .ascx file.
Pretty simple:
~~~~~~~~~~~~~~
<script runat="server">
Sub Page_Load(S as Object, E as EventArgs)
dim myStreamWriter as StreamWriter
myStreamWriter = File.CreateText(MapPath("../pages/content_includes/" & Request.QueryString("page") & ".ascx"))
myStreamWriter.WriteLine(Session("previewText"))
myStreamWriter.Close
End Sub
</script>
~~~~~~~~~~~~~
It works great with one funny exception. The client manufacturers power
transformers, and in on of their .ascx files, they use the ?symbol a ton.
This character can also be displayed with µ
Here's the thing.... whenever the file is re-written with the code above, it
changes the symbol to 纰
Pretty simple:
~~~~~~~~~~~~~~
<script runat="server">
Sub Page_Load(S as Object, E as EventArgs)
dim myStreamWriter as StreamWriter
myStreamWriter = File.CreateText(MapPath("../pages/content_includes/" & Request.QueryString("page") & ".ascx"))
myStreamWriter.WriteLine(Session("previewText"))
myStreamWriter.Close
End Sub
</script>
~~~~~~~~~~~~~
It works great with one funny exception. The client manufacturers power
transformers, and in on of their .ascx files, they use the ?symbol a ton.
This character can also be displayed with µ
Here's the thing.... whenever the file is re-written with the code above, it
changes the symbol to 纰