2

Can someone see the code-behind of an .aspx website from a browser?

I have been told it is possible but i cant really find a way of doing it , viewing the page source only shows the presentation page..

So is there a way of doing it ? and how?

thank you

3
  • No one can see server side code in browser !!! They see only HTML Commented Nov 20, 2012 at 13:14
  • create an aspx page with a code-behind. Run in your browser. Right click and "View Page Source". Can you see the code-behind? Commented Nov 20, 2012 at 13:17
  • As i said when i view page source i am able to see only the "presentation" page but i am quite new in all this and since ive been told its possible i thought maybe there is another way .. its pretty clear now thank you all Commented Nov 20, 2012 at 13:22

2 Answers 2

4

No, it is not possible to see the codebehind without physical or remote access to the server itself.

You could also in theory misconfigure the IIS server to display the source files, and that would cause them to be displayed, rather than compiled, but no idea why anyone would do that. IIS by default will not display them.

Sign up to request clarification or add additional context in comments.

Comments

4

By default, IIS shows parts of your code (aspx or code-behind) when an exception occurs - along with the call stack of the exception. Any serious ASP.NET application hides this information from users by using specific error handlers to show the error information in another (often more user-friendly) format.

As others mentioned, it's not normally possible to see the code, as it's a server-side handler, compiled and run on the server, while client only sees the HTML output.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.