no code in webform using vs.net, but in webform using notepad

  • Thread starter Thread starter timmso
  • Start date Start date
T

timmso

If I create a webform in notepad (save it with an .aspx extension), I can
see the VB.Net code along with the ASP.Net code in one file.

If I create an Asp.Net web application and add a web form using VS.Net, only
the Asp.Net code is behind the web form.

Where is the VB.Net code stored? And why is it stored differently than the
first way I mentioned?

Thanks.
 
Hi Timmso,

VS.Net utilizes the concept of "code behind", where the code/logic to run a
webpage is stored in a class that inherits from the Page class. Your ASPX
page then inherits from this codebehind class.

The code for your file is stored in an aspx.vb file, in the same folder.
Try Project>Show All Files. The .vb files are then compiled into a DLL, and
do not need to be uploaded to the production machine.

IMO, "codebehind" is an ok idea in concept, but is doesn't work well in
practice in most scenarios -- a change to the .vb file requires rebuilding
the application. I've found it best to build middle-tier objects in vs.net,
and use dreamweaver or webmatrix to develop the application. Neither use
codebehind.

Alex Papadimoulis
 
Back
Top