471,317 Members | 1,339 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

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 1244
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

31 posts views Thread by John Roth | last post: by
9 posts views Thread by Bengt dePaulis | last post: by
70 posts views Thread by Michael Hoffman | last post: by
34 posts views Thread by Reinhold Birkenfeld | last post: by
2 posts views Thread by Rob Cowie | last post: by
1 post views Thread by William Stacey [MVP] | last post: by
6 posts views Thread by bukzor | last post: by
reply views Thread by rosydwin | last post: by

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.