This is a migrated thread and some comments may be shown as answers.

[Solved] loading panel

5 Answers 248 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kim Boarder
Top achievements
Rank 1
Kim Boarder asked on 21 May 2008, 01:21 PM

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">

&nbsp;<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>&nbsp;

<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...">

&nbsp;<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>

&nbsp;&nbsp;<br />

&nbsp;

<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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

&nbsp;<br />

&nbsp;<br />

<script type="text/javascript">

document.aspnetForm.ctl00$Main$Login1$UserName.focus();

document.aspnetForm.ctl00$Main$Login1$UserName.select();

</script>

<br />

<br />

&nbsp;  

<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 &copy;

School Test. Site best viewed at 1024 x 768.

</small>&nbsp;&nbsp; &nbsp;&nbsp;

</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

5 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 21 May 2008, 02:02 PM
Hi Kim Boarder,

The reason for the problem you are facing is that you are adding the RadAjaxLoadingPanel in the RadAjaxManager settings, which is nor supported. The LoadingPanel is wrapped in regular asp Panel, which is updated control for the AjaxManager. Please try to place the LoadingPanel out of the updated asp:Panel and let us know if it works.

Greetings,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kim Boarder
Top achievements
Rank 1
answered on 23 May 2008, 05:27 PM
I just noticed you replied now. Should I get a notification via email as I didn't.

Anyway, so I just want to make sure I got this straight. In the AjaxManager, I should not put anything in there for the Default Panel?
Ok, so I moved the loadingpanel out of the asp:panel. It still doesn't seem to be working but maybe I misunderstood.

Thanks for your reply,
Kim
0
Maria Ilieva
Telerik team
answered on 27 May 2008, 05:57 AM
Hi Kim,

After you moved the loading panel out of the asp Panel, what remains as updated control in the RadAjaxManager settings? Are you still updating the user control with RadAjax? Please find attached a sample project which covers your scenario and is working correctly. Test it on your side and let us know what the difference in your case is.

If the problem still persists on your side, please open a regular support ticket and send us sample runnable application to debug it locally. Thus we could test it and advise you further.

Kind regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kim Boarder
Top achievements
Rank 1
answered on 29 May 2008, 04:22 PM
Ok, I got the loading panel to finally work. Now, I put this on our server and it is no longer displaying. I'm thinking its a setup issue on the server. These are the files I have on the server in my bin folder...

 System.Web.Extensions.Design.dll
System.Web.Extensions.dll
Telerik.Web.UI.dll
Telerik.Web.UI.xml


Is there anything else that I need to do on the server to get this to work?
0
Maria Ilieva
Telerik team
answered on 02 Jun 2008, 02:05 PM
Hello Kim Boarder,

These are the correct dll files, which should be in the bin folder. I believe that the issue is not directly related to the  server setup.  Will it be convenient for you to open a regular support ticket and send us a sample runnable project, which replicates the issue? We will gladly test it locally and advise you further.

Regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Kim Boarder
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Kim Boarder
Top achievements
Rank 1
Share this question
or