Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fast question about putting your code in another file

Status
Not open for further replies.

jakeir

Programmer
Joined
Apr 7, 2009
Messages
25
Location
US
Hi,

I noticed that any site I go to that has an ASP.NET extension (that is .aspx) in it, I cannot find any ASP.NET code in it. So, I did some research and I figured that they are puting the code in another file, like using the CodeBehind technique; where they put the code in another file. But then you are supposed to see something like this:

<%@

Page Language="C#" AutoEventWireup="true"

CodeFile="Default.aspx.cs" Inherits="_Default"

%>

But I do not see anything like this either.
can someone tell me what they are doing?

Thank you
 
You can't see ANY asp.net code from a browser, that is the whole point of a server side language.

ASP.NET is server side and looking at the source in the browser will just show you what HTML was sent by the server.

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
Oh Okay, that explains it. I am just learning this, and while I knew that it was ran on the server I thought that you would see the code.
Thank you for your help
 
No, the server processes the code and just returns HTML to the client.

Imagine how insecure it would be if you saw the code which could contain things such as usernames and passwords to connect up to a database...

Mark,

Darlington Web Design[tab]|[tab]Experts, Information, Ideas & Knowledge[tab]|[tab]ASP.NET Tips & Tricks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top