
January 10th, 2003, 08:14 PM
|
|
dotNetBB Forums Developer
|
|
Join Date: Dec 2002
Posts: 265
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
|
The web.config is used to hold settings and values that determine both how your application should override the default site settings and custom variables that can be used. This is unlike the global.asax page which can contain function and subs that fire on session or application events.<br><br>An example of how it might be used would be in holding the connection string to your database like this :<div class="msgQuoteWrap"><div class="msgCode"><br><add key="dataStr" value="SERVER=YOURSERVER;DATABASE=YOURDATABASE;UID=YOURUS ERID;PWD=YOURPASSWORD" /><br></div></div><br>That would then be accessable in your application (VB.NET example) by using : <div class="msgQuoteWrap"><div class="msgCode"><br>Protected connStr As String = ConfigurationSettings.AppSettings("dataStr")<br></div></div><p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><b><i>Building A Better Community, One Post At A Time</i></b><br><a href="http://www.dotnetbb.com" target="_blank">www.dotnetbb.com</a></p>
|