Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


which method marks a config file section for encryption?



which method marks a config file section for encryption?..

Answer / guest

protected void Page_Load(object sender, EventArgs e) {
Configuration config;
ConfigurationSection configSection;
config = WebConfigurationManager.OpenWebConfiguration
(Request.ApplicationPath);
configSection = config.GetSection("connectionStrings");
if (configSection != null) {
if (!(configSection.SectionInformation.IsLocked)) {
configSection.SectionInformation.ProtectSection("
DataProtectionConfigurationProvider");
config.Save();
} } }


To unprotect :

Public Sub Page_Load()
Dim config As Configuration
Dim configSection As ConfigurationSection
config = WebConfigurationManager.OpenWebConfiguration
(Request.ApplicationPath)
configSection = config.GetSection("connectionStrings")
If Not (configSection Is Nothing) Then
If Not (configSection.SectionInformation.IsLocked) Then
configSection.SectionInformation.UnprotectSection()
config.Save()
End If
End If
End Sub

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More ASP.NET Interview Questions

What does clearing cache?

0 Answers  


What is ascx?

0 Answers  


Where would you use an iHTTPModule, and what are the limitations of any approach you might take in implementing one

1 Answers  


What are the asp.net security controls?

0 Answers  


What is a 401 redirect?

0 Answers  


What is the method used to load generated dataset with data on the DataAdapter control ?

3 Answers   Siebel,


How we can set Different levels of Authentication in .Net? What are the difference between Windows Authenticatin, Passport Authentication and Form Authentication?

1 Answers  


Explain server side state management system.

0 Answers  


What are the action filters available in asp.net mvc

1 Answers   TCS,


What is a windows service?

0 Answers  


How do we invoke queries from the application?

3 Answers   Microsoft,


what is client-server architecture in .net? and what is 3-tier architecture?

1 Answers  


Categories