Hi,The below is the connection string in Web.Config File.We are Using Inproc Session:
timeout="1440"/>
I need to Encrypt and Decrypt ConnectionString.Example:I seacrh in google ,So i tried with RSAProtectedConfigurationProvider.
when i encrypt the file in web.config , the connectionstring is encrypted.
Configuration confg =WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);
ConfigurationSection configSect = confg.GetSection("connectionStrings");
if (configSect != null)
{
configSect.SectionInformation.ProtectSection("RSAProtectedConfigurationProvider");
confg.Save();
}
Above code is i copied in Login_Click Event , when the user gives username and pwd and click the button.
If successfull user redirecting to the page.
Response.Redirect("Sample.aspx");
It redirecting to Sample.aspx page , but the session null again redirecting to Home.aspx.
In Sample.aspx page:
public void Page_Load()
{
if (Session[USER_NAME] == null)
{
Response.Redirect( Home.aspx");
}
else
{
}
Why Session is Null? Can you please suggest me how to secure that connectionstring and users have to access my site without any problems.
Thanks,
Suresh

Sukesh MarlaRank #461 · 5.4K reputationPosted Sep 27, 2012, 9:45 AM EDT