How to include ".inc" files in .aspx pages?
-
Hi All, I have a problem, i need to include ".inc" file in to my ".aspx" file as i have some code in the inc file which i have to re-use. can any one suggest me how to do this, I need to include the file to access the database details which are in the ".inc" file. Thanks in Advance. chandu
chandu
-
Hi All, I have a problem, i need to include ".inc" file in to my ".aspx" file as i have some code in the inc file which i have to re-use. can any one suggest me how to do this, I need to include the file to access the database details which are in the ".inc" file. Thanks in Advance. chandu
chandu
I wouldn't advise you to use includes though. They were useful in the days of classic ASP as a means of reusing script code. However the object-orientated nature of .NET means there are more sophisticated means of reusing code e.g. Master Pages, User Controls etc. Anyway, database connection details should be stored in your web.config file. There is a specific <connectionstrings/> section for them.
Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush
-
Hi All, I have a problem, i need to include ".inc" file in to my ".aspx" file as i have some code in the inc file which i have to re-use. can any one suggest me how to do this, I need to include the file to access the database details which are in the ".inc" file. Thanks in Advance. chandu
chandu
Your database code should be in a class, or in a dll. It sure should not be included with .inc files.
Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )