ASP.NET Source Code Viewer
page 1 of 1
Published: 01 Oct 2003
Unedited - Community Contributed
Abstract
With a few changes you can use the ASP.NET Source Code Viewer that is included with Microsoft's Quickstart Samples on your web site.
by Andrew Mooney
Feedback
Average Rating: 
Views (Total / Last 10 Days): 11637/ 19

Use the Source Code Viewer that is included with the .NET Framework

With a few changes you can use the ASP.NET Source Code Viewer that is included with Microsoft's QuickStart Samples on your web site. You can use this viewer to list all of an application's files for viewing or to just view one file at a time. Start by copying srcview.aspx, SrcCtrl.ascx, srcctrlwin.aspx, and style.css to a directory in your web site. Edit the path information to match the new directory on lines 1, 10, 140, and 142 of srcview.aspx and lines 2 and 6 of srcctrlwin.aspx. Edit your Web.Config file (see View Source). Only files in the root directory, specified in Web.Config, can be viewed.

That's all the changes that are required. Now you can use the ASP.NET Source Code Viewer in two ways. The first way is to use a .src file that contains a list of files you want users to view. An example .src file is included with the source files for this article. Files to be viewed can be in the same directory as the .src file or in sub directories. The second way is used to display only one file. You first have to change listonly property on line 15 of srcview.aspx file to true. Hyperlink examples for both methods can be found with the source files for this article.

[ Run Sample ] | [ View Source ] | [ Download ]



User Comments

No comments posted yet.






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-16 1:39:28 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search