Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
hello friends,
 
I save as my one .aspx page in asp.net after save the new page has no .cs file only .aspx file
 
how can i add my .cs file for .aspx file plz suggest me
Posted 16-Jul-12 21:18pm
Comments
Sebastian T Xavier at 17-Jul-12 2:19am
   
Are you using visual studio?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

When you add a new aspx page there is one option under the page with the checkbox that Place Code in Separate File. Just check this and u get automatically get the .cs file for your aspx page.
  Permalink  
Comments
chetan virkar at 17-Jul-12 5:55am
   
5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

hi,
 
if you are using Visual Studio, once you add any .aspx page, the code file will also created. check in the HDD project folder, do you see the code file? if yes, then Go to solution explorer is visual studio, right click on the aspx page and click "View Code". then you will find the code file.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

If you are using Visual Studio, then when you are adding a new ASPX file to your website or solution, there would be a checkbox saying Place code in separate file. If you select the checkbox, VS will create a CS file along with your ASPX file.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

If you are using Visual studio then while adding the web page it gives an option to "Put Code in Separate File".
 
if this option is checked then only the page will contain a separate code behind .cs file. otherwise visual studio assumes that you will be putting your C# code inside the aspx page under script tags.
 
If you still need to add .cs file to a web page follow the conventions in this links and you should be able to ad it:
 
http://support.microsoft.com/kb/303247[^]
http://blogs.msdn.com/b/mikhailarkhipov/archive/2006/04/13/576117.aspx[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 480
1 Maciej Los 304
2 Richard MacCutchan 225
3 BillWoodruff 169
4 Suraj Sahoo | Coding Passion 155
0 OriginalGriff 8,759
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,269
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411028.1 | Last Updated 17 Jul 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100