Public Sub PageValidate(ByVal sender As Object, ByVal e As
System.EventArgs)
SessionApp_Validation()
Page_Access()
End Sub
Private Sub SessionApp_Validation()
Try
If (Session("GUID") = "") Or (Session("UserName") = "") Or
(Session("UserGroupCode") = "") Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
If (Session("UserGroupCode").ToString() <> "I1") And
(Session("UserGroupCode").ToString() <> "IA") And (Session("COGUID") = "")
Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
If (IsNothing(Application.Get(Session("GUID").ToString())))
Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
If Not (Application.Get(Session("GUID").ToString()).ToString()
=
Session.SessionID.ToString()) Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
Catch exp As Exception
objHelper.LogEvent(exp, "IndustryWeb.Security")
Session.Abandon()
Response.Redirect("default.aspx")
End Try
End Sub
Private Sub Page_Access()
Dim cMotherPage As String
Dim ldsPage As New DataSet()
Dim ldrwPage As DataRow()
Try
cMotherPage = Request.ServerVariables("URL")
cMotherPage = Right(cMotherPage, Len(cMotherPage) -
Len(Application.Get("Root")))
If cMotherPage <> "default.asp" Then
ldsPage =
CType(Application.Get(Session("UserGroupCode").ToString()), DataSet)
ldrwPage = ldsPage.Tables(0).Select("FileName='" &
cMotherPage & "'") ' and Access = 'Y'")
If (Not (ldrwPage.Length > 0)) Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
If Session("Suspend").ToString() And
ldrwPage(0).Item("ViewInSuspended").ToString() <> "Y" Then
Session.Abandon()
Response.Redirect("default.aspx")
End If
End If
If cMotherPage <> "ChangePromptPass.aspx" And
Session("Prompt").ToString() <> "N" Then
Response.Redirect("ChangePromptPass.aspx")
End If
If UCase(Session("UserGroupCode").ToString()) = "AU" Then
If cMotherPage <> "ChangePromptPass.aspx" And cMotherPage
<>
"User_Preference.aspx" And Session("IsAIF") And Not
(Session("HasPreference")) Then
Response.Redirect("User_Preference.aspx")
End If
End If
Catch exp As Exception
objHelper.LogEvent(exp, "IndustryWeb.Security")
End Try
End Sub
[\code]
First User Control. login.ascx
[code]
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
End Sub
[\code]
Inside global.asax.cs
[code]
Public Class Global
Inherits System.Web.HttpApplication
Dim mobjHelper As New Helpers()
Private Const modName As String = "Application"
Public Function PageAccess(ByVal astrUserGroupCode As String) As
DataSet
Dim lobjDBHelper As New DBHelper()
Dim lobjMenuTools As New
WebMenuTools(Application.Get("Connection").ToString())
Dim ldsPage As New WebMenuDS()
Try
ldsPage = lobjMenuTools.GetMenuDS(astrUserGroupCode.ToString())
Return ldsPage
Catch exp As Exception
mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
Finally
lobjDBHelper.Close()
ldsPage.Dispose()
End Try
End Function
Public Function UserGroupGet() As SqlDataReader
Dim lobjDBHelper As New DBHelper()
Dim ldrUserGroup As SqlDataReader
Try
With lobjDBHelper
.ConnectionString =
Application.Get("Connection").ToString()
.Open()
ldrUserGroup = .ExecuteReturnDR("sp_RFUserGroups_Get",
CommandType.StoredProcedure)
End With
Return ldrUserGroup
Catch exp As Exception
mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
Finally
lobjDBHelper.Close()
End Try
End Function
Public Sub AppVar()
Dim lobjDBHelper As New DBHelper()
Dim ldrEntity As SqlDataReader
Try
With lobjDBHelper
.ConnectionString =
Application.Get("Connection").ToString()
.Open()
ldrEntity = .ExecuteReturnDR("sp_entity_get",
CommandType.StoredProcedure, _
.mp("@IndustryName", DbType.String, 50, ""))
End With
Do While (ldrEntity.Read())
Application.Add(ldrEntity("IndustryName").ToString(),
ldrEntity("IndustryID").ToString())
Loop
Catch exp As Exception
. . .
Finally
lobjDBHelper.Close()
End Try
End Sub
. . ..
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Dim ldrUserGroup As SqlDataReader
Dim lobjIndustryDB As New ConnectionStrings()
Try
Application.Add("Connection",
lobjIndustryDB.Industry.ToString())
Application.Add("DocConnection",
lobjIndustryDB.Document.ToString())
Application.Add("AIFConnection", lobjIndustryDB.AIF.ToString())
Application.Add("Root", "/InsuranceWeb/")
Application.Add("BatchQueue", "FormatName:Direct=TCP:<ip
address>\private$\<folder name>")
AppVar()
ldrUserGroup = UserGroupGet()
If Not (IsNothing(ldrUserGroup)) Then
Do While (ldrUserGroup.Read())
Application.Add(ldrUserGroup("UserGroupCode").ToString(),
PageAccess(ldrUserGroup("UserGroupCode").ToString()))
Loop
ldrUserGroup.Close()
Else
End If
Catch exp As Exception
mobjHelper.LogEvent(exp, "IndustryWeb." & modName, True)
Finally
End Try
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session ends
Dim lobjDBHelper As New DBHelper()
Try
With lobjDBHelper
.ConnectionString =
Application.Get("Connection").ToString()
.Open()
.ExecuteNonQuery("sp_Last_Login_Update",
CommandType.StoredProcedure, .mp("@GUID", DbType.Guid, 16, New
Guid(Session("GUID").ToString())))
End With
Application.Remove(Session("GUID").ToString())
Catch exp As Exception
End Try
End Sub
End Class
[\code]
Hope this makes it clearer. Thanks for the reply.
Den2005
--
MCP Year 2005, Philippines
[QUOTE="Joe Kaplan (MVP - ADSI)"]
Do you have a recursive function in the call stack?
Joe K.
Hi everybody,
Do not where to put this post? So, here is my case...
Opening and login on the web page created by another person causes
the
JIT Debugger Dialog to appear with a message: An exception
'System.StackOverflowException' has occurred in ... and when you click
No,
the web page displays Server Application Unavailable. We are using
domain
accounts here. What user account to use, how to set which accounts to
use?
what rights do this account needs? I need help. Thanks in advanced.
Web Page Message:
Server Application Unavailable
Application Log Message:[/QUOTE][/QUOTE][/QUOTE]