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

When is the ViewState available during the page processing cycle ?

6 Answers   Siebel,


33) You create English, French, and German versions of your ASP.NET application. You have separate resource files for each language version. You need to deploy the appropriate resource file based on the language settings of the server. What should you do? A . Create an installer and set the Installer.Context property for each version of your application. B . Create an installer that has a launch condition to verify the locale settings. C . Create an installer that has a custom action to install only location-specific files. D . Create an installer that has an MsiConfigureProduct function to install the appropriate version.

2 Answers   Friedkin, ISH, Syntax, Syntax Softtech,


What is state management in asp.net and define Client-side state management and Server-side state management?

2 Answers   TVS,


Where is ViewState information stored?

18 Answers   DSRC, HCL,


Why is string called immutable data type?

0 Answers  


how can i insert array values and retreive in asp.net

3 Answers   TCS, Value Labs,


How to deploy/publish webservices?How many ways?Plz explain me

0 Answers   TCS,


What is work flow gen? how can it will work with .Net?

0 Answers   TCS,


What are validators and list some validators of asp.net?

0 Answers  


Where code pages are used?

0 Answers   Blue Star,


When would you set a control's AutoPostBack property to true?

1 Answers  


.Net Doesn't offer Deterministic Distruction ? a) True b) False

4 Answers   CTS,


Categories