Click here to Skip to main content
15,900,667 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to maintain state of treeview after post back? Pin
Ravi Munde8-Jan-09 18:30
Ravi Munde8-Jan-09 18:30 
AnswerRe: How to maintain state of treeview after post back? Pin
Sundar_R8-Jan-09 19:02
Sundar_R8-Jan-09 19:02 
GeneralRe: How to maintain state of treeview after post back? Pin
Ravi Munde8-Jan-09 22:00
Ravi Munde8-Jan-09 22:00 
QuestionHow to make Plugins in asp.net ? Pin
Piyush Vardhan Singh8-Jan-09 18:24
Piyush Vardhan Singh8-Jan-09 18:24 
AnswerRe: How to make Plugins in asp.net ? Pin
Abhijit Jana8-Jan-09 19:17
professionalAbhijit Jana8-Jan-09 19:17 
GeneralRe: How to make Plugins in asp.net ? Pin
Piyush Vardhan Singh8-Jan-09 19:42
Piyush Vardhan Singh8-Jan-09 19:42 
QuestionHi....drag and drop Pin
madancode8-Jan-09 18:02
madancode8-Jan-09 18:02 
QuestionProblem encrypt connection strings in web.config Pin
alyy04068-Jan-09 17:46
alyy04068-Jan-09 17:46 
Hi,

I am having problem when i try to encrypt my connection strings in the web.config file. Error: An error occured loading a configuration file: Failed to map the path '/'

My connection strings as below:
<connectionStrings>
		<add name="Database_MARISConnectionString" connectionString="Data Source=MEXTERMSC;Initial Catalog=Database_MARIS;User ID=test;Password=test1234"
   providerName="System.Data.SqlClient" />		
 </connectionStrings>


My code for encrypt and decrypt connectionstrings:
Imports System.Configuration
Imports System.Web.Security
Imports System.Web.Configuration
Imports Msecurity


Partial Class mARIS_Default3
    Inherits System.Web.UI.Page
    Public tmprptno As String
    Protected Sub page_load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    End Sub
    Private provider As String = "RSAProtectedConfigurationProvider"
    Private section As String = "connectionStrings"

    Protected Sub btnEncrypt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEncrypt.Click
        Try
            Dim conf As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
            Dim confStrSect As ConfigurationSection = conf.GetSection(section)
            If Not confStrSect Is Nothing Then
                confStrSect.SectionInformation.ProtectSection(provider)
                conf.Save()
            End If
            'the encrypted section is automatically decrypted!!
            Response.Write("Configuration Section " & " <b>" & WebConfigurationManager.ConnectionStrings("Database_MARISConnectionString").ConnectionString & "</b>" & " is automatically decrypted")
        Catch ex As Exception
            UpdateEvent("Configuration Manager:Encrypt:" & ex.Message)
            ex = Nothing
        End Try
    End Sub

    Protected Sub btnDecrypt_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDecrypt.Click
        Try

            Dim conf As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
            Dim confStrSect As ConfigurationSection = conf.GetSection(section)
            If Not confStrSect Is Nothing AndAlso confStrSect.SectionInformation.IsProtected Then
                confStrSect.SectionInformation.UnprotectSection()
                conf.Save()
            End If

        Catch ex As Exception
            UpdateEvent("Configuration Manager:Decrypt:" & ex.Message)
            ex = Nothing
        End Try
    End Sub
End Class


The encrypt and decrypt code i get from Programmatically Encrypt and Decrypt Configuration Sections in web.config using ASP.NET 2.0 & ASP.NET 3.5[^]">
Questionhow do I read a file name located in a specific folder into a C# app Pin
Tina P8-Jan-09 17:27
Tina P8-Jan-09 17:27 
AnswerRe: how do I read a file name located in a specific folder into a C# app Pin
Tina P8-Jan-09 18:12
Tina P8-Jan-09 18:12 
QuestionSet Listbox scroll position after Postback Pin
dsrao8-Jan-09 15:58
dsrao8-Jan-09 15:58 
AnswerRe: Set Listbox scroll position after Postback Pin
Rajdev Ramasamy12-Jan-09 2:49
Rajdev Ramasamy12-Jan-09 2:49 
QuestionHyperlink in a TextBox - Possible? Pin
kavitha_blueindia8-Jan-09 13:31
kavitha_blueindia8-Jan-09 13:31 
AnswerRe: Hyperlink in a TextBox - Possible? Pin
Not Active8-Jan-09 17:13
mentorNot Active8-Jan-09 17:13 
AnswerRe: Hyperlink in a TextBox - Possible? Pin
Rajdev Ramasamy12-Jan-09 2:11
Rajdev Ramasamy12-Jan-09 2:11 
QuestionHelp on ecommerce web programming Pin
atplerry8-Jan-09 13:02
atplerry8-Jan-09 13:02 
AnswerRe: Help on ecommerce web programming Pin
Not Active8-Jan-09 17:19
mentorNot Active8-Jan-09 17:19 
GeneralRe: Help on ecommerce web programming Pin
atplerry12-Jan-09 0:37
atplerry12-Jan-09 0:37 
QuestionWhy does web.config automatically save itself? Pin
Tomz_KV8-Jan-09 10:06
Tomz_KV8-Jan-09 10:06 
AnswerRe: Why does web.config automatically save itself? Pin
Jon Rista8-Jan-09 10:18
Jon Rista8-Jan-09 10:18 
QuestionBest third party components suite for Asp.Net Ajax Pin
lotuzwine8-Jan-09 9:57
lotuzwine8-Jan-09 9:57 
AnswerRe: Best third party components suite for Asp.Net Ajax Pin
ToddHileHoffer8-Jan-09 10:19
ToddHileHoffer8-Jan-09 10:19 
GeneralRe: Best third party components suite for Asp.Net Ajax Pin
lotuzwine9-Jan-09 1:40
lotuzwine9-Jan-09 1:40 
QuestionSaving data from a placeholder control [modified] Pin
AllPhee8-Jan-09 4:41
AllPhee8-Jan-09 4:41 
AnswerRe: Saving data from a placeholder control Pin
Not Active8-Jan-09 5:35
mentorNot Active8-Jan-09 5:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.