<% function GetUserRole(name, password, redirectpage) if Application("ValidateUser") = 0 then exit function ElseIf name <> "" then dim KVWebUserChecker set KVWebUserChecker = Server.CreateObject("KVWebSvr.UserChecker") if not KVWebUserChecker is Nothing then session("UserRole") = KVWebUserChecker.ValidateUser(name, password) set KVWebUserChecker = Nothing end if If session("UserRole") = 0 then Session("ErrorMsg") = "Sorry,user name or password is invalid.Please log on again!" Response.Redirect("Error.asp") end if ElseIf session("UserRole") = 0 then Response.Redirect("Login.asp?RedirectPage=" & redirectpage) end if end function %>