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 |
What are strong names?
what is use of doctype tag in asp.net
Can we store PROGID information in database and dynamically load the component ?
1 Answers Digital GlobalSoft, e4e,
What does setting a control's EnableViewState property to false accomplish?
Which template must you provide, in order to display data in a Repeater control?
What?s the difference between Response.Write() and Response.Output.Write()?
2 Answers Siebel, Visual Soft,
What is application Object?
Tell something about state management in asp.net?
Define satellite assemblies.
What will happen if the server confugration file and the application confugration file have different values for sassion state ASP.NET?
Where does Web.Config Info stored? Will this be stored in the registry?
When during the page processing cycle is ViewState available?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)