 |
| Visual Web Developer 2005 Discuss creating ASP.NET 2.0 sites with Microsoft's Visual Web Developer 2005. If your question is more specific to a piece of code than the Visual tool, see the ASP.NEt 2.0 forums instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Visual Web Developer 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 13th, 2008, 11:03 PM
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No Provider Created!
I've followed the instruction step by step from this article --http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=404. When i open the Web Site Administration Tools, click the Provider tab and then click the "Select a different provider for each feature (advanced)" link. --------- No Provider Created. Pls help! Below is the web.config code. I'm using the Visual Studio 2005 and Access 2000 database.
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="AccessFileName" connectionString="~/App_Data/ASPNetDB.mdb" providerName="System.Data.OleDb"/>
</connectionStrings>
<system.web>
<authentication mode="Forms">
<forms loginUrl="mylogin.aspx" defaultUrl="Login.aspx"/>
</authentication>
<membership defaultProvider="AccessMembershipProvider">
<providers>
<clear/>
<add name="AccessMembershipProvider"
type="Samples.AccessProviders.AccessMembershipProv ider, SampleAccessProviders"
connectionStringName="AccessFileName"
enablePasswordRetrieval="false"
enablePasswordReset="false"
requiresUniqueEmail="false"
requiresQuestionAndAnswer="false"
minRequiredPasswordLength="1"
minRequiredNonalphanumericCharacters="0"
applicationName="SampleSite"
hashAlgorithmType="SHA1"
passwordFormat="Hashed"/>
</providers>
</membership>
<roleManager enabled="true"
defaultProvider="AccessRoleProvider"
cacheRolesInCookie="true"
cookieName=".ASPXROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All">
<providers>
<add name="AccessRoleProvider"
type="Samples.AccessProviders.AccessRoleProvider,
SampleAccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"/>
</providers>
</roleManager>
<profile enabled="true"
defaultProvider="AccessProfileProvider">
<providers>
<add name="AccessProfileProvider"
type="Samples.AccessProviders.AccessProfileProvide r,
SampleAccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"
description="Stores and retrieves profile data from an
SampleAccessProviders database."/>
</providers>
<properties>
<add name="FriendlyName" type="string"
allowAnonymous="true" serializeAs="String"/>
<add name="Height" type="int" allowAnonymous="true"
serializeAs="String"/>
<add name="Weight" type="int" allowAnonymous="true"
serializeAs="Xml"/>
</properties>
</profile>
<anonymousIdentification enabled="true"
cookieName=".ASPXANONYMOUS" cookieTimeout="100000"
cookiePath="/" cookieRequireSSL="false"
cookieSlidingExpiration="true" cookieProtection="None"
domain=""/>
<webParts>
<personalization
defaultProvider="AccessPersonalizationProvider">
<providers>
<add name="AccessPersonalizationProvider"
type="Samples.AccessProviders.AccessPersonalizatio nProvider, SampleAccessProviders"
connectionStringName="AccessFileName"
applicationName="SampleSite"/>
</providers>
</personalization>
</webParts>
<!--
<trust level="Medium"/>
-->
<compilation debug="true"/>
<pages>
<namespaces>
<clear />
<add namespace="System" />
<add namespace="System.Collections" />
<add namespace="System.Collections.Specialized" />
<add namespace="System.Configuration" />
<add namespace="System.Text" />
<add namespace="System.Text.RegularExpressions" />
<add namespace="System.Web" />
<add namespace="System.Web.Caching" />
<add namespace="System.Web.SessionState" />
<add namespace="System.Web.Security" />
<add namespace="System.Web.Profile" />
<add namespace="System.Web.UI" />
<add namespace="System.Web.UI.WebControls" />
<add namespace="System.Web.UI.WebControls.WebParts" />
<add namespace="System.Web.UI.HtmlControls" />
</namespaces>
</pages>
</system.web>
</configuration>
|
|

October 14th, 2008, 10:26 PM
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi, Imar. Thanks for your reply. I had tried to add the <clear/> in the <provider> section. It's still cannot work. I'm quite new to ASP.Net 2.0. I have no idea what's going wrong with my web.config. Pls help..
|
|

October 15th, 2008, 03:00 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Your config file looks OK, I diffed it with the one from article, and it looks pretty much identical.
So, you need to provide more info about your setup. Where (on disk) is the site located? How do you open the project in VWD? Is web.config in the root of your site? What happens if you delete the existing web.config file and replace it with a blank new one?
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
|
|

October 15th, 2008, 11:31 PM
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had followed the instructions step by step. By using the Visual Studio 2005, I had created a project called SampleAccessProviders, using the access providers which I downloaded from Microsoft MSDN site. Then i created a blank new website using Visual Studio 2005. The website is located at C:\Documents and Settings\Hardsoft\My Documents\Visual Studio 2005\WebSites\WebSite1. I had copied the AspNetDB into App_Data folder and SampleAccessProviders.dll into Bin folder. I had replaced the web.config file with the one created in SampleAccessProviders project. The web.config is in the root of the website. There's nothing happen when i delete the web.config and replace with the previous one. For your information, just now I've tried to do the setup again, it can work now. Maybe I've made a mistake during the setup. When i click on the "Select a different provider for each feature (advanced)" link, then i can see the Access Provider is now the selected provider for both the Membership and the Roles feature. Then how do i use this Web Site Administration Tools to set the user access right and the security level?
|
|

October 19th, 2008, 09:15 PM
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yeah! I saw the link. I had read through it. I had created 2 roles, administrators and users. I only want the administrators to add, edit and delete the record from database. I had created access rules to restrict user access the App_Data and _UpgradeReport_Files folder. When i use the User account login the website. I still can add, edit and delete record. I just wonder how this web site administration tools can restrict the user accessbility. Please advice.
|
|

November 4th, 2008, 01:55 AM
|
|
Registered User
|
|
Join Date: Oct 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your reply. For your information, i stored my database in C:\ drive. Then i stored my project in C:\Inetpub\wwwroot\Project. How do i set the rules for the admin and user role? I want only the admin can edit, update and delete the records in database. Now, i use these coding to hide the control buttons.
'Determine whether admin or user is visiting the page?
Dim userName As String = User.Identity.Name
If String.Compare(userName, "admin", True) = 0 Then
'this is admin, show the functionality button
btnAdd.Visible = True
btnDeleteSelected.Visible = True
btnReset.Visible = True
GridView1.Columns(0).Visible = True
GridView1.Columns(1).Visible = True
Else
'this is not admin, hide the functionality button
btnAdd.Visible = False
btnDeleteSelected.Visible = False
btnReset.Visible = False
GridView1.Columns(0).Visible = False
GridView1.Columns(1).Visible = False
End If
|
|
 |