Imports System.Data.Common
Imports System.DirectoryServices
Partial Class _Default
    Inherits System.Web.UI.Page

    'www.51aspx.com

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strUrl As String = "~/"
        Dim TmpQuery = DB_Template.clsTemplateList.GetLinq(CType(BaseFunction.PublicMethod.GetApplication("SiteID"), Integer))
        Dim defaultTmp As DB_Template.TemplateList = (From t In TmpQuery _
                                                     Where t.IsDefault = True _
                                                     Select t).FirstOrDefault

        Dim clsTmpClass As New DB_Template.clsTemplateClass
        Dim defaultTmpClass As DB_Template.TemplateClass = clsTmpClass.GetSingle(defaultTmp.ClassID)
        strUrl = "~/Sites/Site" & BaseFunction.PublicMethod.GetApplication("SiteID") & "/Template" & defaultTmpClass.ID & "/" & defaultTmp.FileName & ".aspx"
        Dim clsURL As New DB_Template.clsTemplateURL
        Dim strSendto As DB_Template.TemplateURL = clsURL.GetSingle(strUrl)
        If strSendto IsNot Nothing Then
            Response.Redirect(strSendto.LookFor.Replace("\.", "."))
        End If
    End Sub
End Class
