I am trying to use a loading panel for when I authenticate a user, but it does not display. It's driving me crazy. This is the first time I've used RadControls. Here is the code below. Any ideas what I'm missing. Thanks in advance. KB
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%
@ Register Src="WebUserControl.ascx" TagName="WebUserControl"TagPrefix="uc1" %>
<%
@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml" >
<
head id="Head1" runat="server">
<title>Test</title>
<link rel="stylesheet" href="stylesheet.css?version=1" type="text/css" />
</
head>
<
body vlink="blue" >
<form id="form1" runat="server" autocomplete="off" class="titles">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" style="height: 100px; width: 100%; background-image: url('images/header.gif')">
<asp:Image ID="Image1" ImageUrl="~/images/temp.jpg" runat="server" />
</td>
</tr>
</table>
<span class="titles" style="text-align:center">Welcome to my test<br />
</span>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<br />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Login1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<br />
<asp:Login ID="Login1" runat="server" DisplayRememberMe="False"
TitleTextStyle-CssClass="image" TitleText="IEP Login" Width="334px" BackColor="#EFF3FB" BorderColor="#B5C7DE" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" ForeColor="#333333">
<TextBoxStyle Width="150px" CssClass="image" Font-Size="0.8em" />
<TitleTextStyle CssClass="gridTitles" BackColor="#6699CC" Font-Bold="True" Font-Size="0.9em" ForeColor="White" />
<InstructionTextStyle Font-Italic="True" ForeColor="Black" />
<LoginButtonStyle BackColor="White" BorderColor="#6699CC" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="0.8em" ForeColor="#6699CC" />
</asp:Login>
<asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px">
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
Width="75px" BorderColor="Black" HorizontalAlign="Center" MinDisplayTime="5" ToolTip="loading...">
<img alt="Loading..." src="Loading.gif" style="border-right: 0px; border-top: 0px;
border-left: 0px; border-bottom: 0px"
/>
</telerik:RadAjaxLoadingPanel>
<uc1:WebUserControl id="WebUserControl1" runat="server"></uc1:WebUserControl>
</asp:Panel>
<br />
<asp:Label ID = "lblMessage" runat="server" Text="" style="top: 215px"></asp:Label>
<table style=" margin-left:auto; margin-right:auto; border-width:1" >
<tr>
<td align="center" style="height: 155px; width: 7px;" rowspan="1" ></td>
</tr>
</table>
<br />
<span class="bodyText"></span>
<br />
<br />
<script type="text/javascript">
document.aspnetForm.ctl00$Main$Login1$UserName.focus();
document.aspnetForm.ctl00$Main$Login1$UserName.select();
</script>
<br />
<br />
<br />
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="TABLE1" onclick="return TABLE1_onclick()">
<tr>
<td style="width: 100%; height: 15px;" class="footer">
<small>All contents copyright ©
School Test. Site best viewed at 1024 x 768.
</small>
</td>
</tr>
</table>
<asp:SiteMapDataSource ID="SiteMapDataSource1" Runat="server" />
</form>
</
body>
</
html>
---------------------------------------------------------------------------------------------------------------------
Option
Explicit On
Option
Strict On
Imports
System
Imports
System.Collections
Imports
System.ComponentModel
Imports
System.Configuration
Imports
System.Web
Imports
System.Data
Imports
System.Web.sessionstate
Imports
System.Data.OracleClient
Imports
System.Security.Cryptography
Imports
System.Text
Imports
System.DirectoryServices
Imports
System.Drawing
Imports
Telerik.Web.UI
Imports
System.Web.UI.WebControls
Imports
System.Web.UI.HtmlControls
Partial
Class _Default
Inherits System.Web.UI.Page
Protected Sub Login1_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles Login1.Authenticate
Dim DBConn As OracleConnection = Nothing
Dim dCmd As OracleCommand = Nothing
Dim intRetVal As Integer
Dim md5Hasher As New MD5CryptoServiceProvider()
Dim encoder As New UTF8Encoding()
Dim intLoginCount As Integer
Dim temp As String = "True" 'test only
Dim session As System.Web.SessionState.HttpSessionState = HttpContext.Current.Session
Try
'connect to the db
Session(
"ConnectionString") = ConfigurationManager.ConnectionStrings("DBConn").ConnectionString
session(
"destpage") = "~/destpage"
If IsAuthenticated(Login1.UserName.ToString, Login1.Password.ToString) Then
' if temp = "True" then
System.Threading.Thread.Sleep(9000)
FormsAuthentication.SetAuthCookie(
CStr(Login1.UserName), False)
DBConn = New OracleConnection(session("ConnectionString").ToString)
DBConn.Open()
dCmd =
New OracleCommand
With dCmd
.Connection = DBConn
.CommandText =
"pkg.test"
.CommandType = CommandType.StoredProcedure
.Parameters.Add(
"pUserId", OracleType.VarChar).Value = Login1.UserName
.Parameters.Add(
"pErrorMsg", OracleType.VarChar, 200).Direction = ParameterDirection.Output
.Parameters.Add(
"vRetVal", OracleType.VarChar, 5).Direction = ParameterDirection.ReturnValue
End With
intRetVal = dCmd.ExecuteNonQuery
'test if successful
If dCmd.Parameters("vRetVal").Value.ToString = "FALSE" Then
'user was not authenticated
Login1.FailureText =
"You do not have access."
Else
dim sb as StringBuilder = New StringBuilder() 'May15
session(
"username") = Login1.UserName.ToString
session(
"password") = Login1.Password.ToString
sb.append(
"<form name=t id=t action=ED/default.asp method=post>")
If session("destpage").ToString IsNot Nothing Then
sb.append(
"<input type=hidden name=destpage value=" + session("destpage").ToString + ">")
End If
sb.append(
"</FORM>")
sb.append(
"<scr" + "ipt>t.submit();</scr" + "ipt>")
Response.Write(sb)
End If
Else
If IsNothing(session("LoginCount")) Then
'create count
session(
"LoginCount") = 1
Else
intLoginCount =
CInt(session("LoginCount").ToString)
If intLoginCount < 3 Then
intLoginCount += 1
End If
session(
"LoginCount") = intLoginCount
End If
'user does not exist
Login1.FailureText =
"Login ID or password is incorrect. "
End If
Catch ex As Exception
lblMessage.Text =
"There was an error during login."
Finally
If (Not IsNothing(DBConn)) Then
DBConn.Close()
End If
dCmd =
Nothing
End Try
End Sub
Private Function IsAuthenticated(ByVal username As String, ByVal pwd As String) As Boolean
Dim domainAndUsername As String = username
Dim deMasterEntry As DirectoryEntry
Try
'Create the master entry object
deMasterEntry =
New DirectoryEntry("LDAP://ec-dc1.abcde.ca", domainAndUsername, pwd, AuthenticationTypes.Secure)
Dim obj As Object = deMasterEntry.NativeObject
Return True
Catch ex As Exception
Dim EventLog1 As System.Diagnostics.EventLog = New System.Diagnostics.EventLog()
EventLog1.Source =
"KB"
EventLog1.WriteEntry(
"Could not authenticate AD master account. Message: " & ex.Message & " Source: " & ex.Source)
Return False
End Try
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
lblMessage.Text =
""
End Sub
End
Class