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

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?
 
J

Juan T. Llibre

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
===========
 
S

Suhaib Khan

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"

/>
 
S

SirPoonga

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top