This project is read-only.

How to include my aspx page

Topics: General, Writing modules
Jun 25, 2011 at 9:47 PM



I have a simple ASPX page with some lines of code to show my MP3 files. I tought it was easy to include MP3 library by just using moduls and installed the feature "MediaGarden" with Audio Player. But whole Orchard V1.2.41 just throws errors after this is installed. I decided to try to include my lines of code into a page. Can you advice me step-by-step how to get my code working in Orchard?


Imports System
Imports System.Web
' We need System.IO namespace to read and write to disc
Imports System.IO
Partial Class Default2
 Inherits System.Web.UI.Page
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   ' Gets full path to text file, in this example page will read itself
   Dim FilePath As String = Server.MapPath("data/Audiolist.txt")
   ' Creates instance of StreamReader class
   Dim sr As StreamReader = New StreamReader(FilePath)
   ' Finally, loads file to string
   Dim FileContent As String = sr.ReadToEnd()
 End Sub
End Class

Jun 28, 2011 at 12:32 AM

Well, you're not providing any details, such as the error you're seeing so that's hard to say. But in any case, if the code is simple, why don't you just move it into a controller in a custom module?