The simplest ASPX page deployment

G

Guest

I used a text editor to create a aspx file and its code-behind c# file, then
I put these two files in the ...inetpub\wwwroot\test folder. When I tested
it, the result was that the code-behind is ignored.

When I used Visual Studio to do the same, the result was correct. Please
advise.
Peter
 
S

S. Justin Gengo

Peter,

The code needs to be compiled and the resulting .dll file needs to be in the
bin folder of the website (you also need the .aspx page with the display
code in it). The codebehind file isn't used in a deployed site.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

I havent tried this. But I believe you will need to compile the C# code
behind using csc.exe before deployment..
 
K

Kevin Spencer

It's all a matter of the model you use. You can use a page without a
CodeBehind, a page with a compiled CodeBehind (in a DLL in the \bin folder),
or a page with a non-compiled CodeBehind. Visual Studio uses the compiled
CodeBehind model by default. To use a non-compiled CodeBehinid, you have to
change the @Page directive, add a "src" attribute which specifies the
location of the CodeBehind file. The "CodeBehind" attribute is used only at
compile-time, and does not come into play at run-time. If you put the class
execution in a Code Block in the page, and don't use a separate CodeBehind
file, you don't need the "src" attribute.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top