Hi,
I'm fairly new to ASP and even newer to ATLAS. I have built an ASP 2.0 website using the starter kits. I was able, bearly, to configure the web.config file in the starter kit to use the M$ SQL Server database running on the server.
Now, I'm trying to learn ATLAS and I'm finding that my lack of understanding of the structure of the web.config file is really screwing me over. I have a couple of questions.
Is there documentation somewhere that explains all the elements that go into the web.config file? What changes do I need to make to the web.config file for ATLAS in order to use the servers database?
Here is what my web.config file looks like:
<?
xmlversion="1.0"?><
configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"><
configSections><
sectionGroupname="microsoft.web"type="Microsoft.Web.Configuration.MicrosoftWebSectionGroup"><
sectionname="converters"type="Microsoft.Web.Configuration.ConvertersSection"requirePermission="false"/><
sectionname="webServices"type="Microsoft.Web.Configuration.WebServicesSection"requirePermission="false"/><
sectionname="authenticationService"type="Microsoft.Web.Configuration.AuthenticationServiceSection"requirePermission="false"/><
sectionname="profileService"type="Microsoft.Web.Configuration.ProfileServiceSection"requirePermission="false"/></
sectionGroup></
configSections><
microsoft.web><
converters><
addtype="Microsoft.Web.Script.Serialization.Converters.DataSetConverter"/><
addtype="Microsoft.Web.Script.Serialization.Converters.DataRowConverter"/><
addtype="Microsoft.Web.Script.Serialization.Converters.DataTableConverter"/></
converters><
webServicesenableBrowserAccess="true"/></
microsoft.web><
appSettings/><
system.web><
roleManagerenabled="true"defaultProvider="AspNetWindowsTokenRoleProvider" /><
authenticationmode="Forms"/><
pagestheme="Default"><
controls><
addnamespace="Microsoft.Web.UI"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/><
addnamespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Atlas"tagPrefix="atlas"/></
controls></
pages><
compilationdebug="true"><
buildProviders><
addextension=".asbx"type="Microsoft.Web.Services.BridgeBuildProvider"/></
buildProviders><
assemblies><
addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><
httpHandlers><
removeverb="*"path="*.asmx"/><
addverb="*"path="*.asmx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/><
addverb="*"path="atlasbatchcall.axd"type="Microsoft.Web.Services.MultiRequestHandler"validate="false"/><
addverb="*"path="atlasglob.axd"type="Microsoft.Web.Globalization.GlobalizationHandler"validate="false"/><
addverb="*"path="*.asbx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/></
httpHandlers><
httpModules><
addname="ScriptModule"type="Microsoft.Web.Services.ScriptModule"/><
addname="BridgeModule"type="Microsoft.Web.Services.BridgeModule"/><
addname="WebResourceCompression"type="Microsoft.Web.Services.WebResourceCompressionModule"/></
httpModules></
system.web></
configuration>There should not be anything different *just* for using the atlas controls. If you store your connection info in the web.config (like many of us do) then you store them the same way, by adding a section that looks something like this:
<
connectionStrings><
addname="NameYouPick"providerName="System.Data.SqlClient"connectionString="ConnectionString Provided by your server host or check Connectionstrings.com" /></connectionStrings>
ok,
What I don't understand is that my web.config file has no mention of any connectionString. So how does it create/use the db that it creates automatically when I use the ASP .NET Configuration tool?
I want to configure the web.config file so that when I click on the ASP .NET Configuration menu it actually does the work on the database on my server; this database is on the same server that serves the webpages.
Like I said, using the starter kits was easy because the web.config file had connectionString entires and all I had to do was change the properties.
I tried to make changes as you suggusted:
<?
xmlversion="1.0"?><
configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"><
connectionStrings><
addname="Personal"connectionString="Data Source=192.168.2.104;Initial Catalog=monkeyLove;Persist Security Info=True;UID=*******;PWD=********"providerName="System.Data.SqlClient" /></
connectionStrings><
configSections><
sectionGroup....... more stuff that I left out becuase i didn't change it from my first example.and I got this error when I tried to run ASP .NET Configuration: (line 6 is right after </connectionString>)
Only one element allowed per config file and if present must be the first child of the root element. (D:\Visual Studio 2005\WebSites\MonkeyLoveBeta\web.config line 6)
Well, to your first question, I'm not positive but I suspect that the admin tool has it's own web.config that it uses. It modifies your web.config but doesn't use it for its own settings. Also, I will say that there's no requirement to put a connection string in the web.config in order to use a database. You could just as easily define it as you go, although it's obviously harder to maintain that way.
The error you're describing suggests that you already have a connectionStrings entry in your latest web.config, the default one that gets added in mine when I use the config tool is right after the <appSettings> entry.
No comments:
Post a Comment