Is there a way to include files in asp.net?

  • Thread starter Thread starter SirPoonga
  • Start date Start date
S

SirPoonga

Right now at the top of each of my asp.net pages I have
<%@ Page Language="VB" Debug="true" %>

That's fine and dandy but when it comes time for me to switch debug to
true I'd rather have a central location to switch it, not go through
each file.

Is there a way to do that?
 
Include in your web.config, this :

<compilation debug="true" defaultLanguage="vb">

That will set debug to true for all pages.

You should use a Find-and-Replace utility to delete the
<%@ Page Language="VB" Debug="true" %>
from all your pages.

If at any point you decide you don't need to debug
any more, change the web.config entry to :

<compilation debug="false" defaultLanguage="vb">

best,



Juan T. Llibre
ASP.NET MVP
===========
 
Look at compilation tag in Web.config file you can set Debugging or not
Debuggin for the entire application.

<!-- DYNAMIC DEBUG COMPILATION

Set compilation debug="true" to enable ASPX debugging. Otherwise, setting
this value to

false will improve runtime performance of this application.

Set compilation debug="true" to insert debugging symbols (.pdb information)

into the compiled page. Because this creates a larger file that executes

more slowly, you should set this value to true only when debugging and to

false at all other times. For more information, refer to the documentation
about

debugging ASP.NET files.

-->

<compilation

defaultLanguage="c#"

debug="true"

/>
 
Can I put that in a local web.config.
I added that line in my web.config (which also contains appsettings).
However I get this error:
I even read
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=307


Configuration Error
Description: An error occurred during the processing of a configuration
file required to service this request. Please review the specific error
details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized configuration section 'compilation'

Source Error:


Line 13: <add key="indexheader" value="Index" />
Line 14: </appSettings>
Line 15: <compilation debug="true" defaultLanguage="vb"/>
Line 16: </configuration>
 
Back
Top