Click here to Skip to main content
15,911,141 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear sir,
I have added a single function in App_Code file.Now i want to upload it on webserver.
I want to know is that before uploading it on the web server is there any process which should follow(e.g. compilation or anything else) or simply upload on the server.
Becouse i edited App_code folder and simply overrite it on the web server.from then my website is giving runtime error.

Any help will be highly appreciated.

Thanks
Abhishek
Posted
Comments
Sergey Alexandrovich Kryukov 12-May-12 0:29am    
Not enough information. By the way, I wonder: is it not obvious that there is not enough information? :-)
--SA
abhiamity86 12-May-12 2:11am    
Thanks for reply,
Sir need to add some code in App_code folder.So i wanted to confirm is that what is the procedure for that like simple add code in App_code folder or some special steps need to require.

Regards
Abhishek

1 solution

what is the procedure for that like simple add code in App_code folder
No special step needed. Just place the class file in the App_Code folder.

When you add just a class to the root for the first time, it should ask you to place it in App_Code folder. If it does not exists, it creates one. In case this has not happened with you then, try creating the folder manually and place the class file there. (Once you create the folder, it's color would automatically change to some other color then a general folder color.)

It's just that, if we store any class files (like .cs or .vb), ASP.NET handles files in special ways - compiler compiles them automatically. Putting class file now by creating App_Code will not do anything as its a compile time thing! This article would be a good read for you: Shared Code Folders in ASP.NET Web Site Projects [^]

Also, have a look at this article: Beginner's Guide to ASP.NET Application Folder[^]
 
Share this answer
 
v2
Comments
abhiamity86 12-May-12 2:57am    
Thanks Sir,

I have done the same but still website giving error.Its not working.
Error is --
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customerrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customerrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customerrors mode="Off">




Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customerrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customerrors mode="RemoteOnly" defaultredirect="mycustompage.htm">

Sandeep Mewara 12-May-12 5:34am    
As said, out the custom errors tag OFF and see what issue is there. Acutal error will come on the yellow screen.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900