473,491 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CodeFiel and path

WT
Hello,

I have my code pages in App_Code\Subdir\ *aspx..cs folder,
the coresponding aspx are in \Subdir\*.aspx .

Compiler can't find the aspx when compiling the aspx.cs
and generates error for the controls from the aspx page.

This code is working perfectly in vs2003.

should I include a path in the CodeFile directive?
And how to do this ?
Same question for CodeFileBaseClass ?

Thanks for help.
CS

Jan 13 '06 #1
5 1282
Hello,

The folder "App_Code" is a special folder in ASP.NET 2.0, you can not put
*.aspx.cs in this folder.

If you need to put some code/logic in "App_Code" , you can define a class
and put your logic in the class. The class will be put in the folder
"App_Code" and you can refer the class in your *.aspx.cs.

Luke

Jan 13 '06 #2
WT
Luke,
Sorry but it is unclear.
May be you don't understand the problem (my fault).
My problem is migrating a large web site project containing many folders
with .aspx and related .aspx.cs files.
The migration wizard kept the folders in project root directory, keeping
only the .aspx files.
The .aspx.cs files have been automatically moved in the App_code folder,
copying the original folder hierachy under App_code.
And this does not compile because compiler can't create the relation
between the aspx and the codebehind.
CS


"Luke Zhang [MSFT]" <lu******@online.microsoft.com> a écrit dans le message
de news: ST**************@TK2MSFTNGXA02.phx.gbl...
Hello,

The folder "App_Code" is a special folder in ASP.NET 2.0, you can not put
*.aspx.cs in this folder.

If you need to put some code/logic in "App_Code" , you can define a class
and put your logic in the class. The class will be put in the folder
"App_Code" and you can refer the class in your *.aspx.cs.

Luke

Jan 13 '06 #3
WT
Understood,

My actual project was the result of beta 2 migration wizard, I will
rearrange the files to have the aspx.cs in same folder as aspx

Thanks
"Luke Zhang [MSFT]" <lu******@online.microsoft.com> a écrit dans le message
de news: ST**************@TK2MSFTNGXA02.phx.gbl...
Hello,

The folder "App_Code" is a special folder in ASP.NET 2.0, you can not put
*.aspx.cs in this folder.

If you need to put some code/logic in "App_Code" , you can define a class
and put your logic in the class. The class will be put in the folder
"App_Code" and you can refer the class in your *.aspx.cs.

Luke

Jan 13 '06 #4
WT
Still problem with the CodeFileBaseClass.
Could we create subfolders in in App_code
How to write the corresponding CodeFileBaseClass ?
Thanks again

"Luke Zhang [MSFT]" <lu******@online.microsoft.com> a écrit dans le message
de news: ST**************@TK2MSFTNGXA02.phx.gbl...
Hello,

The folder "App_Code" is a special folder in ASP.NET 2.0, you can not put
*.aspx.cs in this folder.

If you need to put some code/logic in "App_Code" , you can define a class
and put your logic in the class. The class will be put in the folder
"App_Code" and you can refer the class in your *.aspx.cs.

Luke

Jan 13 '06 #5
CodeFileBaseClass specifies a path to a base class for a page. You can just
put your base class name here. For exmaple,

CodeFileBaseClass="MyPage"

The file "MyPage.cs" can be app_code or a sub folder of app_code.

Luke

Jan 17 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
3866
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
9
3581
by: Bengt dePaulis | last post by:
I have a local directory that I want to include in my sys.path How to save it permanently? Regards /Bengt
70
4010
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
34
3221
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
2
23359
by: Rob Cowie | last post by:
Hi, Given a string representing the path to a file, what is the best way to get at the filename? Does the OS module provide a function to parse the path? or is it acceptable to split the string...
1
5829
by: William Stacey [MVP] | last post by:
I need a bullet proof way to combine a root and a relative path to form a FQ rooted path (similar to a VDir in IIS). Path.Combine alone will not do the job in all cases. I also need to be sure...
5
8601
by: Sakharam Phapale | last post by:
Hi All, I am using an API function, which takes file path as an input. When file path contains special characters (@,#,$,%,&,^, etc), API function gives an error as "Unable to open input file"....
8
11456
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
6
4035
by: bukzor | last post by:
I have to go into these convulsions to get the directory that the script is in whenever I need to use relative paths. I was wondering if you guys have a better way: from os.path import dirname,...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.