Welcome Guest Search | Active Topics | Sign In | Register

Response Redirect within a CallbackPanel Options
Jim
Posted: Wednesday, November 17, 2010 4:07:35 PM
Rank: Newbie
Groups: Member

Joined: 11/17/2010
Posts: 2
Hi everyone,

I'm using a Callbackpanel within an aspx page and using response redirect within my code behind on a login aspx file for my app and it's not working with the following error:

EO.Web control 'CallbackPanel1' error message: The callback on 'CallbackPanel1' has failed because the server did not recognize this callback and processed it as a normal request. This can occur if there are multiple Callback/Callbackpanel controls in the page, and this call/callbackpanel control was intially dynamically loaded but wasn't loaded for this callback.


Here's what I've done to resolve the problem as recommended based on what I've read here.

1. Check the version of EO Web dll I'm using. I'm using 8.0.40.2.
2. I've placed the following in my web config file:
<httpModules>
<add name="EOWebRuntime" type="EO.Web.Runtime,EO.Web"/>
</httpModules>
3. I've tried replacing the response redirect with callback redirect and that doesn't work at all!

Here's my code that controls the redirection.

If userName.ToUpper.Trim = "DDI@TEST" Then
divErrMsg.InnerHtml = "Cannot process password retrieval on a demo account. Please contact your Customer Service Representative for assistance."
Else
FormsAuthentication.RedirectFromLoginPage(userName, False)
Response.Redirect("~/forms/pwRetrv.aspx")
End If

Have I missed something obvious. I'm on a tight deadline and would appreciate some help.

Thanks,

-- Jim Angel


Here's my aspx Page:

Code: HTML/ASPX
<%@ Page  Language="VB" MasterPageFile="~/App_mp.master" AutoEventWireup="false"
    CodeFile="msLogin.aspx.vb" Inherits="Forms_msLogin"  Title="MissionSTAT - Login"%>

<%@ MasterType VirtualPath="~/app_MP.master" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <eo:Dialog ID="ldpanel" runat="server" BackShadeColor="white" BackShadeOpacity="20"
        AnchorElementID="divPage" ShowDirection="Top" OffsetX="350" OffsetY="50">
        <ContentTemplate>
            <div class="ddi_Processing">
                Processing...<img alt='Processing' src='../images/processing.gif' /></div>
        </ContentTemplate>
    </eo:Dialog>
 <eo:CallbackPanel runat="server" ID="CallbackPanel3" ChildrenAsTriggers="True" AutoDisableContents="True"
        SafeGuardUpdate="true" LoadingDialogID="ldpanel" GroupName="ctrl">
    <div id="divLogon" style="width: 220px; padding: 0px; margin: 0px;">
        <fieldset style="padding: 10px; margin: 0px;">
            <legend id="legendIC">Sign in to MissionSTAT</legend>
            <table>
                <tbody>
                    <tr>
                        <td style="padding-left: 10px; width: 50px;">
                            User ID:
                        </td>
                        <td>
                            <asp:TextBox ID="tbUserId" runat="server" SkinID="ddi_tb_std_skin" ToolTip="Assigned account User ID."></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left: 10px; width: 50px;">
                            Password:
                        </td>
                        <td>
                            <asp:TextBox ID="tbPword" runat="server" TextMode="Password" SkinID="ddi_tb_std_skin"
                                ToolTip="Password to your Mission STAT account."></asp:TextBox>
                        </td>
                    </tr>
                </tbody>
            </table>
          
            <div style="padding-top: 5px;">
                <div style="padding-left: 6px; float: left;">
                    <asp:Button ID="btnSignIn" runat="server" Text="Sign In" SkinID="buttonskin" EnableViewState="true"
                        ToolTip="Click to Sign In." UseSubmitBehavior="true" />
                </div>
                <div style="float: right; padding-right: 6px;">
                    <asp:Button ID="btnForgotPassword" runat="server" Text="Forgot Password" SkinID="buttonskin"
                        EnableViewState="true" ToolTip="Click to retrieve your password." />
                </div>
            </div>
         
        </fieldset>
    </div>
            
       </eo:CallbackPanel>
    <%--  
    
    modal window for data entry error indication
    
    --%>
        <eo:CallbackPanel runat="server" ID="CallbackPanel1" 
        ChildrenAsTriggers="True" AutoDisableContents="True" GroupName="ctrl" 
        Triggers="{ControlID:btnSignIn;Parameter:},{ControlID:btnForgotPassword;Parameter:}">
    <eo:Dialog ID="eoErrMsgBox" runat="server" BackShadeOpacity="45" BackShadeColor="LightBlue"
                Width="350px" TopMost="True" ImageBaseDirectory="~/App_Themes/ddi_common/Img"  ClientSideOnEnd="fnClickErrOK"
                BackColor="White" HeaderHtml="Error - Incorrect Data Entry" AcceptButton="btnErrOk"
                CloseButtonUrl="errCloseBtn.png" AcceptButtonPostBack="True" CancelButton="">
                <HeaderStyleActive CssText="background-image:url('errHdrBgrnd.gif');background-repeat:repeat-x;font-size:8pt;padding-bottom:17px;padding-left:8px;padding-right:3px;padding-top:0px;margin:0px;" />
                <FooterStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px;" />
                <ContentStyleActive CssText="padding-right: 4px; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; padding-top: 4px; color:red;">
                </ContentStyleActive>
                <BorderImages BottomBorder="errBtmBorder.gif" BottomLeftCorner="errBmLC.gif" BottomRightCorner="errBmRC.gif"
                    LeftBorder="errLB.gif" RightBorder="errRB.gif" TopBorder="errTB.gif" TopLeftCornerBottom="errTopLCbtm.gif"
                    TopRightCorner="errTopRC.gif" TopRightCornerBottom="errTopRCbtm.gif" TopLeftCorner="errTopLC.png" />
                <ContentTemplate>
                    <div id="divErrMsg" style="color: Red;" runat="server">
                    </div>
                </ContentTemplate>
                <FooterTemplate>
                    <asp:Button ID="btnErrOk" runat="server" Text="Ok" SkinID="buttonskin" />
                </FooterTemplate>
            </eo:Dialog>
            </eo:CallbackPanel>


Here's my vb code:

Code: Visual Basic.NET
Here's my vb Code:

    Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
        If Not Page.IsPostBack Then
                       'retrieve login if returning from account activation, password retrieval, or signout
            If Not Request.QueryString("ln") Is Nothing Then
                tbUserId.Text = Request.QueryString("ln")
            End If

            divErrMsg.InnerHtml = ""
            tbUserId.Focus()
        Else

        End If
    End Sub

    Protected Sub btnSignIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSignIn.Click
        Dim userName As String = tbUserId.Text.ToUpper.Trim
        Dim password As String = tbPword.Text.Trim

        divErrMsg.InnerHtml = ""

        'Before anything check username and password exists
        divErrMsg.InnerHtml = IIf(userName.Length = 0, "Unsuccessful login.  Please re-enter your information and click Sign In again.", "")

        If divErrMsg.InnerHtml.Length = 0 Then
            divErrMsg.InnerHtml = IIf(password.Length = 0, "Unsuccessful login.  Please re-enter your information and click Sign In again.", "")
        End If

        If divErrMsg.InnerHtml.Length = 0 Then

            'No errors so far
            'First determine if it is an already existing user and they are legitimized
            Dim memuser As MembershipUser = Membership.GetUser(userName)
            Dim dqCust = From cust In appDB.CustomerBases _
                                 Where cust.CustomerNumber = userName

            'Eval if customer already exists
            If dqCust.Count > 0 Then
                'Customer exists so check if they are active
                If dqCust.First.IsUser Then
                    If Not (memuser Is Nothing) Then
                        If (Membership.ValidateUser(userName, password)) Then
                            'They are a legitimate user so reroute as
                            'legitimate user
                            If userName = "DDI@CREP" Then
                                FormsAuthentication.RedirectFromLoginPage(userName, False)
                                Response.Redirect("~/forms/acctSeqR.aspx")
                            Else
                                FormsAuthentication.RedirectFromLoginPage(userName, False)
                                Response.Redirect("~/forms/ctdEntry.aspx?InstStat=-1")
                                'Response.Redirect("~/forms/ctdRept.aspx")
                            End If
                        Else
                            'Login is unsuccessful so show error popup.
                            divErrMsg.InnerHtml = "Unsuccessful login.  Please re-enter your information and click Sign In again."
                            eoErrMsgBox.Show()
                        End If
                    Else
                        divErrMsg.InnerHtml = "Problem with user account.  Please contact Diamond Diagnostics. (error - 500)"
                        eoErrMsgBox.Show()
                    End If
                Else
                    If userName = password Then
                        'Customer account exists but user account doesn't
                        'meaning user is new but not activated, user needs to activate account
                        FormsAuthentication.SetAuthCookie(userName, False)
                        Response.Redirect("~/forms/acctActv.aspx")
                    Else
                        divErrMsg.InnerHtml = "Unsuccessful login.  Please re-enter your information and click Sign In again."
                        eoErrMsgBox.Show()
                    End If

                End If

            Else
                'Customer doesn't exist so check to phase 2 from customer sequence table
                'Eval if customernumber is next in the sequence
                If Len(userName) = 10 Then
                    Dim dqCustSeq = From seq In appDB.CustomerSequences _
                                    Where seq.CustomerNumberSequence = Left(userName, 5)

                    If dqCustSeq.Count > 0 Then
                        'Customer sequence exists so now check the remaining 5 characters
                        Dim iLast As Integer = CInt(dqCustSeq.First.LastSequenceNumber.Trim)

                        Try

                            Dim iLoginId As Integer = CInt(Right(userName, 5))

                            If iLoginId = (iLast + 1) Then

                                'Legitimate account. Now check that the password is the same
                                If userName = password Then
                                    FormsAuthentication.SetAuthCookie(userName, False)
                                    Response.Redirect("~/forms/acctActv.aspx")
                                Else
                                    divErrMsg.InnerHtml = "Unsuccessful login.  Please re-enter your information and click Sign In again."
                                    eoErrMsgBox.Show()
                                End If
                            Else
                                'No such customer number found in existing customers or as part of the customer sequence of numbers
                                divErrMsg.InnerHtml = "Unsuccessful login.  Incorrect login sequence number.  Please re-enter your information and click Sign In again."
                                eoErrMsgBox.Show()
                            End If

                        Catch ex As Exception

                            divErrMsg.InnerHtml = "Login ID is incorrect.  Please re-enter your information and click Sign In again."
                            eoErrMsgBox.Show()

                        End Try

                    Else
                        'No such customer number found in existing customers or as part of the customer sequence of numbers
                        divErrMsg.InnerHtml = "Unsuccessful login.  Login ID incorrect.  Please re-enter your information and click Sign In again."
                        eoErrMsgBox.Show()
                    End If

                Else
                    'No such customer number found in existing customers or as part of the customer sequence of numbers
                    divErrMsg.InnerHtml = "Unsuccessful login (p2).  Please re-enter your information and click Sign In again."
                    eoErrMsgBox.Show()
                End If

            End If
        Else
            eoErrMsgBox.Show()
        End If

    End Sub


    Protected Sub btnForgotPassword_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnForgotPassword.Click

        Dim userName As String = tbUserId.Text.Trim
        Dim password As String = tbPword.Text.Trim

        divErrMsg.InnerHtml = ""

        'Before anything check username exists
        divErrMsg.InnerHtml = IIf(userName.Length = 0, "Unsuccessful login.  Please re-enter your information and click Sign In again.", "")

        If divErrMsg.InnerHtml.Length = 0 Then
            'Check to see if customer account exists
            Dim dqSeq = From Seq In appDB.CustomerBases _
                        Where Seq.CustomerNumber = userName
            If dqSeq.Count > 0 Then
                'Check if account needs to be activated first
                If Not dqSeq.First.IsUser Then
                    'account needs to be activated first
                    divErrMsg.InnerHtml = "Account needs to be activated to retrieve a new password. Please enter your user id and assigned password and click Sign In to be redirected to account activation."
                Else
                    'reroute to password retrieval
                    Dim auth As String = dqSeq.First.Auth

                    If Membership.ValidateUser(userName, auth) Then
                        ' Account is legit (activated) but user cannot remember password.

                        ' Check to see if user is using the demo account.  If so then
                        ' display message to contact Customer Service Representative.
                        If userName.ToUpper.Trim = "DDI@TEST" Then
                            divErrMsg.InnerHtml = "Cannot process password retrieval on a demo account.  Please contact your Customer Service Representative for assistance."
                        Else
                            FormsAuthentication.RedirectFromLoginPage(userName, False)
                            Response.Redirect("~/Forms/pwRetrv.aspx")
                        End If

                    Else
                        divErrMsg.InnerHtml = "Cannot validate your user account.  Please contact the Diamond Diagnostics IT Department."

                    End If
                End If
            Else
                'Error out
                divErrMsg.InnerHtml = "Unsuccessful login.  Please re-enter your information and click Sign In again."
            End If

        End If


        If divErrMsg.InnerHtml.Trim.Length > 0 Then
            eoErrMsgBox.Show()
        End If

    End Sub

    Protected Sub btnErrOk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnErrOk.Click
        divErrMsg.InnerHtml = ""
        tbUserId.Focus()
    End Sub
eo_support
Posted: Wednesday, November 17, 2010 4:54:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

This is just to let you know that we are able to reproduce the issue but is still working on it in order to give you an accurate answer. We will post again to let you know as soon as we find anything.

Thanks!
eo_support
Posted: Wednesday, November 17, 2010 8:34:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are not able to run your code because it references other contents such as your master page. With our own test page we are able to use Response.Redirect fine if:

1. You have EO.Web.Runtime added into your HttpModule section;

Or

2. You call Response.Redirect(url, false). Note the second argument is false here;

Either case should work fine. It will not work if the module is not in web.config and you call Response.Redirect directly without the second argument.

Thanks
Jim
Posted: Thursday, November 18, 2010 8:33:10 AM
Rank: Newbie
Groups: Member

Joined: 11/17/2010
Posts: 2
It works! response.redirect(<url>,false). Not terminating the execution of the current page did the trick.

Thanks for helping me out and for the quick reply. I think your tools are great, albeit I'm still getting used to them. Well documented and supported. I especially like the cell level editing / updating functionality of your grid.
eo_support
Posted: Thursday, November 18, 2010 8:46:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad to hear that it works for you. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.