473,774 Members | 2,251 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#: Reading MembershipSecti on from Web.config

I need to read values from the Web.Config xml file, particularly the
<MembershipSect ion. Using asp.net 2.0, C#.

I'm writing a custom membership provider.. I've set up a class that
inherets from MembershipProvi er, and all of the override methods have
been started.. but for instanace in the EnabledPassword Reset method, I
want the return value to be read from the config section
enablePasswordR eset..

I see dozens of examples explaining how to read from the appSettings
section, or ConnectionStrin g settings.. but zero examples pulling
values from the membership section in C#. I'd rather have these values
in the xml file rather than returning the value in the class methods
directly.

For instance: my membership section looks like this

<configuration. . <system.web..
<membership defaultProvider ="MembershipPro vider">
<providers>
<add connectionStrin gName="Connecti onString"
applicationName ="secure2"
enablePasswordR eset="false" ****
passwordFormat= "Hashed"
minRequiredPass wordLength="5"
minRequiredNona lphanumericChar acters="0"
name="Membershi pProvider"
type="secure.au th._auth"
requiresQuestio nAndAnswer="fal se"
requiresUniqueE mail="true" />
</providers>
</membership>
... </system.web..</configuration>

And in secure.auth._au th, the other ride methods reside.. here is one:

public override bool EnablePasswordR eset
{
get { throw new Exception("The method or operation is not
implemented."); }
}

I'd like this method to return "false" in this case, because the method
reads the line in the config snippet from above where the **** are
located.

Aug 14 '06 #1
0 1522

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2061
by: Sami | last post by:
Hello, I have this problem that I need your help with : I am reading a config file that contain the following : 2004 update
3
2429
by: spacekid | last post by:
Hi there I am exposing a c# assembly as a COM component (regasm /codebase) and calling it from classic asp. When I try to call the ConfigurationSettings.AppSettings function in the c# assembly, it does not return the values from my web.config. The web.config is located in the root of the web application. The classic asp page that calls the COM exposed c# assembly is located in a subfolder called message. Can anyone help me out here?
2
5106
by: news.microsoft.com | last post by:
Hi After conducting a several searches, I wasn't sure where to post this question. So my apologiesbefore hand for double posting this and possibly posting to the wrong forum(s). Okay, I have any application that uses the data access application building block from Microsoft's Enterprise Library (patterns and practices site). I want to allow the users to select the database connection. To do this, I thought I could read the...
1
1697
by: comic_rage | last post by:
Hi, I am trying to read from my application config file and keep getting null. Here is my config file My application is called SampleApp.exe
10
9471
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a ConfigurationErrorException whenever I do the following: 1. Modify and save the section in code using the System.Configuration.Configuration.Save(). 2. Refresh teh section using ConfigurationManager.RefreshSection 3. Encrypt the section,...
5
10339
by: alf | last post by:
Hi folks, I'm trying to read a web.config section using RoleManagerSection settings = (RoleManagerSection)System.Configuration.ConfigurationManager.GetSection("system.web/roleManager"); and I get the following error on the page: Security Exception Description: The application attempted to perform an operation not allowed
9
2720
by: Milsnips | last post by:
Hi all. i'm tryng to implement the Rewrite.NET url rewritining functionality into a test project i've created, however i am hitting a problem at this line (direct from the web example): System.Collections.Specialized.NameValueCollection SectionIndex = (System.Collections.Specialized.NameValueCollection)System.Configuration.ConfigurationSettings.GetConfig("Rewrite.NET/Index"); The value always returns me null, and just to check it was...
1
7492
by: M Irfan | last post by:
Hello all, Recently I have started working in .NET 2.0. I am developing a web service application that references a DLL component written in C# 2.0. The component has its own config file which contains settings related to business logic coded in that component. I can reference and load the component but unable to read load the custom config file of that component. I know that the same thing is possible if my host application is any Exe...
1
2268
by: vijayarl | last post by:
Hi Everyone, i have the written this logic : basically a file operation open (CONFIGFILE, "$config_file") or die; while (<CONFIGFILE>) { chomp;
0
10267
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5358
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4014
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.