Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

A few questions about web.comfig in ASP.Net

Hi Experts,

A few simple questions about web.comfig in ASP.Net:

1. I put a web.config file, an aspx page and some asp pages in the same site. Will the config affect the asp pages at all?
2. Instead put the web.config file in the root, I put the web.config in a folder, will the config scope be limited in the folder?
3. I only got one aspx page, how can I put the config inside the page?

Thank you in advance.
0
johnwood
Asked:
johnwood
1 Solution
 
sillycornCommented:
1. No, web.config files is only affected .NET defaullt configuration.
2. I think I must show you in example. Let's say you have the IIS running with default c:\inetpub dir. And let's assume that you create the web.config files in your [test] virtual directory (c:\inetpub\wwwroot\test], then it not just affected files in test directory, but also sub-dir in the test directory. Clear now?
3. No, you cannot place/integrate/add the web.config's contain in the .aspx files. Coz web.config files is xml based, cant be downloaded/open using browser (not sure, but almost available book said so, I just take the words from them) and not server side language.

FYI, use or not using web.config files is a relative question, coz if you are not changing any default .net configuration, then you dont need it. In the other hand, if you change the configuration, then you need it.

Hope it helps,
SillyCorn
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now