Click here to Skip to main content
15,892,298 members
Articles / Web Development / ASP.NET

Solution for URL Rewriting in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.24/5 (13 votes)
3 Jul 2007CPOL8 min read 110.1K   803   69  
Powerful solution for URL rewriting and handling rewritten parameters in ASP.NET.
Imports System.Xml

Namespace Rewriting

    Public Class XMLConfigurationManager

#Region "   Properties   "

        Private _configurationPath As String
        Public Property ConfigurationPath() As String
            Get
                Return _configurationPath
            End Get
            Set(ByVal value As String)
                _configurationPath = value
            End Set
        End Property

#End Region

#Region "   Constructor   "

        Public Sub New(ByVal configurationDocumentPath As String)
            ConfigurationPath = configurationDocumentPath
        End Sub

#End Region

#Region "   Public Methods   "

        Friend Function GetConfiguration() As XmlNode

            'Ensure that the configuration path exists
            If Not IO.File.Exists(ConfigurationPath) Then
                Throw New Exception("Could not obtain configuration information")
            End If

            'Load the configuration settings
            Dim settings As New XmlDocument
            settings.Load(ConfigurationPath)
            Return settings.ChildNodes(1)

        End Function

#End Region

    End Class

End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions