Add Code Behind to Web Form

J

jcochran

I have a web form that I need to add a code behind to in asp.net 2.0. I
created the form without the code behind in the first place. How do I
add the code behind after the fact? I cannot find a way to do it in
Visaul Web Developer 2005.

Thanks.
Jason
 
G

Guest

Jason,
The easiest way to figure this out is the "common sense" way:
Just add a new WebForm that does have codebehind, and look at the @Page
directive in the ASPX (HTML) portion of the page.

Then you can do the same for your codebehind-less page, changing the class
names etc. to match.
Peter
 
P

prabhupr

How about
1. Create a new form (this will have .aspx and .cs file)
2. Cut-n-pate the code from OLD aspx to this new aspx
3. Delete the OLD aspx file
4. Rename the new aspx file to old aspx
 

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

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top