473,231 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 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 1273
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
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
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
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
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
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
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
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
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
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
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.