I am writing some sample aspx pages and I would like a quick way to display the actual ASP code that was used to render the page via a hyperlink. Similar to View/Source but I dont want the HTML source code, I want the source code of the actual aspx page on the server. Can anyone think of the EASIEST way to accomplish this? THANKS.Hmmm,<BR><BR>The quickest way I could think of doing it is to copy your .aspx code into a text file (.txt) and then link your (view_source) link to the text file. Of course you wouldn't be able to display your website graphics/headings etc. when showing this file. Maybe you can make the view source link as a popup window. <BR><BR>The advantage of a text only file and not having your site headings etc. is that people can simply copy and paste and try the code, or easily print it out.<BR><BR>actually, thats the first thing I tried just figuring that would work but when i linked to the txt file, nothing showed up in the browser. ????????Yeah, sorry about the .txt file, funny how it doesn't display anything if its code, its a .txt file, why does IE even parse a text file?<BR><BR>Anyway, the solution to your problem is to set the Content-Type of the page to "text". I have code below for a page like this. You will just need to indent the code properly.<BR><BR>Greg<BR><BR><BR><html><BR><head><BR><title>Untitled Document</title><BR><meta http-equiv="Content-Type" content="text"; charset=iso-8859-1"><BR></head><BR><BR><body bgcolor="#FFFFFF" text="#000000"><BR><script language = "vb" runat = "server"><BR><p>Sub Page_Load(ByVal sender As System.Object, _<BR><BR> ByVal e As System.EventArgs) Handles MyBase.Load<BR><BR> <BR><BR> Dim i as Integer<BR><BR> Dim PixelY as Integer<BR><BR> PixelY = 50<BR><BR> For i = 1 to 10<BR><BR> <BR><BR> Dim button As New System.Web.UI.WebControls.Button()<BR><BR> button.Text = "Click me"<BR><BR> button.Style.Item("left") = "10px"<BR><BR> button.Style.Item("top") = PixelY & "px"<BR><BR> button.Style.Item("position") = "absolute"<BR><BR> 'myDiv.innerHTML += "<BR>BUTID = but" & i<BR><BR> 'button.ID = "but" & i<BR><BR> <BR><BR> Me.FindControl("Form1").Controls.Add(button)<BR><BR> 'AddHandler button.Click, AddressOf Me.clickButton<BR><BR> response.write ("<BR>")<BR><BR> <BR><BR> PixelY += 30<BR><BR> myDiv.innerHTML += "<BR>" & i<BR><BR> Next<BR><BR> <BR><BR> End Sub</p><BR><p>Sub clickButton(ByVal sender As Object, _<BR><BR> ByVal e As System.EventArgs)<BR><BR> myDiv.innerHTML = "Button Clicked"<BR><BR> End Sub</p><BR><p><BR><BR> </script></p><BR><p><BR><BR> <form id = "Form1" runat = "server"></p><BR><p><div id = "myDiv" runat = "server" /></p><BR><p><BR><BR> </form><BR><BR></p><BR></body><BR></html>