URL Mapping in asp.net 2.0
URL Mapping is a mechanism by which you can change the displayed url in address bar.
Example
Step1: Add Mapping URL in web.config file.
Step2: Change the URL in .aspx file
Department
Product
Employee
URL Mapping is a mechanism by which you can change the displayed url in address bar.
Example
Step1: Add Mapping URL in web.config file.
Step2: Change the URL in .aspx file
Department
Product
Employee
Configuration File Encryption
In the .NET Framework 2.0, developers will be able to encrypt sensitive parts of the web.config file (if containing password or keys, for instance) using the aspnet_regiis utility. The decryption is done transparently.
The DPAPI protected configuration provider supports machine-level and user-level stores for key storage. The choice of store depends largely on whether or not the application shares state with other applications and whether or not sensitive data must be kept private for each application.
If the application is deployed in the Web farm scenario, developers should use RSAProtectedConfigurationProvider to leverage the ease with which RSA keys can be exported on multiple systems. It uses RSA public key cryptography to provide data confidentiality.
The following example encrypts the connection string section using the tool aspnet_regiis:
try out this…
aspnet_regiis.exe -pef “connectionStrings” C:\VirtualDirectory\Path
How to encrypt connection string in asp.net stored in web.config.
Using System.web.configuration;
Protected void button_click(object sender,eventargs e)
{
string webconfigpath=”~”;
configuration config=webconfigurationmanager.openwebconfiguration(webconfigpath);
configurationsection configsection=config.Getsection(”connectionstrings”);
configsection.sectionInformation.protectsection(”Dataprotectionconfigurationprovider”);
config.save();
}
How to decrypt connection string in asp.net stored in web.config.
Using System.web.configuration;
Protected void button_click(object sender,eventargs e)
{
string webconfigpath=”~”;
configuration config=webconfigurationmanager.openwebconfiguration(webconfigpath);
configurationsection configsection=config.Getsection(”connectionstrings”);
configsection.sectionInformation.Unprotectsection();
config.save();