How to compile the code behind .cs files

G

Guest

I started recently with asp.net 2.0 and I am currently trying to generate the
mysite.dll by compiling the corresponding code behind .cs files. I am using
the csc tool that displays one CS0103 error message (The name '...' does not
exist in current context) for every control id that I am using in the .ascx
files ('...' is the id of the control).

From one point of view this is logical since there are no anymore
declarations for the page controls in the code behind file. However I am
wandering: "How can someone generate the mysite.dll using the command line
compiler in asp.net 2.0?"

Thanks in advance
 
B

bruce barker \(sqlwork.com\)

the codebehind file in 2.0 are partial classes, and can not be compiled
stand alone with the c# compiler. you should use the aspnet compiler
(aspnet_compiler.exe).

-- bruce (sqlwork.com)
 
G

Guest

Then an other question is crossing my mind: Assuming that I am copying a
mypage.aspx and the corresponding mypage.ascx.cs code behind files in the
virtual directory of my application. The asp.net work process will compile
the .cs (and its corresponding complement in .ascx file) automatically before
running the page? If yes, into what assemply is placed the new page class ?
 

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,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top