Tooltip throwing a Sys.WebForms.PageRequestManagerParserErrorException

4 posts, 0 answers
  1. Shannon
    Shannon avatar
    6 posts
    Member since:
    Sep 2013

    Posted 18 Dec 2014 Link to this post

    I am trying to run this tooltip on hover of a grid cell.  The data for the tooltip is in a user control (ascx).  I am banging my head because I keep getting a client side error Sys.WebForms.PageRequestManagerParserErrorException
    <%@ Page Title="" Language="C#"  MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="KioskList.aspx.cs" Inherits="PAMRewrite.KioskList" %>
    <%@ Register Src="PAMStats.ascx" TagName="PAMStats" TagPrefix="uc1" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
        <div id="pagecontent" class="well">   
            <uc1:PAMStats ID="PAMStats1" runat="server" Visible="false" />   
            <h3 runat="server" id="h1">Kiosk List</h3>      
            <asp:UpdatePanel runat="server" ID="updaPnlKioskList" UpdateMode="Conditional" Visible="true">
                <ContentTemplate>   
                    <telerik:RadCodeBlock runat="server" ID="rdbScripts">
                        <script type="text/javascript">
                            function openRadWin(URL) {
                                var width = 1000;
                                var height = 800;
                                var left = 600;
                                var top = 100;
                                var wnd = radopen(URL, null, width, height, left, top);
                                wnd.add_close(OnClientClose);
                            }
     
                            function OnClientClose(sender, args) {
                                window.location.reload(true);
                            }          
                        </script>
                    </telerik:RadCodeBlock>
                    <telerik:RadAjaxPanel runat="server">                   
                        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
                            Top="100" Left="600" Height="800" Width="1000" >                       
                              <Windows>                              
                                   <telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Style="z-index: 8000" Title="CAO" Behaviors="Default" >
                                   </telerik:RadWindow>
                              </Windows>
                         </telerik:RadWindowManager>
                    </telerik:RadAjaxPanel>
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                          <AjaxSettings>
                               <telerik:AjaxSetting AjaxControlID="RadWindowManager1">
                               </telerik:AjaxSetting>
                               <telerik:AjaxSetting AjaxControlID="gvKiosk">
                                    <UpdatedControls>                                   
                                        <telerik:AjaxUpdatedControl ControlID="gvKiosk" LoadingPanelID="RadAjaxLoadingPanel1">
                                        </telerik:AjaxUpdatedControl>
                                        <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1"></telerik:AjaxUpdatedControl>
                                    </UpdatedControls>
                               </telerik:AjaxSetting>
                          </AjaxSettings>
                    </telerik:RadAjaxManager
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
                    </telerik:RadAjaxLoadingPanel>
                    <telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="Default" AutoCloseDelay="7000"
                          Width="325" Height="275" runat="server" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"
                          Position="MiddleRight">
                    </telerik:RadToolTipManager>                            
                    <p>This list contains Pre-Accounts that were created using the CAO Kiosk.  The Signup Step shows the current status of the Pre-Account</p>                          
                    <asp:UpdatePanel runat="server" ID="upReadyToAssignSearch" UpdateMode="Conditional">
                        <ContentTemplate>
                            <telerik:RadGrid ID="gvKiosk" runat="server"
                                AutoGenerateColumns="False"
                                AllowPaging="True"
                                AllowSorting="True"
                                GridLines="None"
                                CellSpacing="0"
                                OnItemDataBound="gvKiosk_ItemDataBound"                   
                                OnItemCommand="gvKiosk_ItemCommand">                                                           
                                <SortingSettings EnableSkinSortStyles="false"></SortingSettings>
                                <GroupingSettings CaseSensitive="false" />
                                <MasterTableView DataKeyNames="Profile_ID" NoMasterRecordsText="There are no Kiosk records.">                    
                                <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True"></PagerStyle>                                                           
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="PROFILE_ID" Display="false"
                                            FilterControlAltText="Filter profileid column" HeaderText="Profile ID"
                                            UniqueName="customername">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="CUSTOMERNAME"
                                            FilterControlAltText="Filter customername column" HeaderText="Customer Name"
                                            UniqueName="customername">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="EMAIL_ADDRESS"
                                            FilterControlAltText="Filter customername column" HeaderText="Email Address"
                                            UniqueName="emailaddress">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="DRIVERS_LICENSE_NO"
                                            FilterControlAltText="Filter customername column" HeaderText="DL#"
                                            UniqueName="driverslicenseno">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="BILLING_ZIP"
                                            FilterControlAltText="Filter zipcode column" HeaderText="Zip Code"
                                            UniqueName="zipcode">
                                        </telerik:GridBoundColumn
                                        <telerik:GridTemplateColumn HeaderText="Details" SortExpression="Details">
                                             <ItemTemplate>
                                                  <asp:HyperLink ID="targetControl" runat="server" NavigateUrl="#" Text="Details"></asp:HyperLink>
                                             </ItemTemplate>
                                        </telerik:GridTemplateColumn>                                                              
                                        <telerik:GridTemplateColumn AllowFiltering="false"
                                            HeaderText="Details" UniqueName="DetailsColumn">
                                            <ItemTemplate>
                                                <asp:LinkButton runat="server" ID="lnkGotoAccount" Text="Go To Account"
                                                    CommandName="GoToAccount"></asp:LinkButton>
                                                  |  
                                                <asp:LinkButton runat="server" ID="lnkCheckIn" Text="Check In"
                                                     CommandName="CheckIn" Visible="false"></asp:LinkButton>
                                                <asp:Label ID="lblProfileID" runat="server" Visible="false" Text='<%#Eval("PROFILE_ID") %>' />
                                                <asp:Label ID="lblBillingZip" runat="server" Visible="false" Text='<%#Eval("BILLING_ZIP") %>' />
                                                <asp:Label ID="lblSignupStep" runat="server" Visible="false" Text='<%#Eval("ACCOUNT_STATUS_DESC") %>' />
                                                <asp:Label ID="lblPreAccountNo" runat="server" Visible="false" Text='<%#Eval("PRE_ACCOUNT_NO") %>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>                           
                                        <telerik:GridBoundColumn DataField="UserName"
                                            FilterControlAltText="Filter customername column" HeaderText="Checked Out By"
                                            UniqueName="UserName">
                                        </telerik:GridBoundColumn>        
                                    </Columns>
                                </MasterTableView>
                                <EditItemStyle BorderWidth="5px" />
                            </telerik:RadGrid>                                     
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </asp:Content>

    using System;
    using System.Data;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using PAMRewrite.PAMBiz;
    using Telerik.Web.UI;
     
    namespace PAMRewrite
    {
        public partial class KioskList : BasePage
        {
            protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
            {
                this.UpdateToolTip(args.Value, args.UpdatePanel);
            }
            private void UpdateToolTip(string elementID, UpdatePanel panel)
            {
                Control ctrl = Page.LoadControl("HoverDetail.ascx");
                ctrl.ID = "ucCustomerDetails1";
                panel.ContentTemplateContainer.Controls.Add(ctrl);
                HoverDetail details = (HoverDetail)ctrl;
                details.profileID = Convert.ToInt32(elementID);
            }
     
            protected void Page_Load(object sender, EventArgs e)
            {           
                string CheckAuth = (string)Session["Authenticated"];
     
                if ((CheckAuth == null) || (CheckAuth == "FALSE"))
                {
                    Response.Redirect("Default.aspx", true);
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                }
                else
                {
                    //  Make sure that UserType is authenticated
                    if ((Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.EXTADMIN)) ||
                            (Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.EXTUSER)))
                    {
                        Response.Redirect("MainMenu.aspx", false);
                        HttpContext.Current.ApplicationInstance.CompleteRequest();
                    }
     
                    Session["Error"] = "FALSE";
     
                    if (!IsPostBack)
                    {
                        FillKioskListGrid();
                        Response.Cache.SetCacheability(HttpCacheability.NoCache);
                        Response.Cache.SetAllowResponseInBrowserHistory(false);
                    }
                    else
                    {
                        //GridView does not keep its items' IDs after postback, so rebind it or else tooltip manager will not show tooltips
                        FillKioskListGrid();
                    }
     
                    // For Stats
                    if (Session["UserType"] != null)
                    {
                        if ((Int32)Session["UserType"] == Convert.ToInt32(cEnums.eUserType.SUPERADMIN) || (Int32)Session["UserType"] == Convert.ToInt32(cEnums.eUserType.INTADMIN))
                        {
                            PAMStats1.Visible = true;
                            RadPanelBar pnlBarStats = (RadPanelBar)PAMStats1.FindControl("pnlBarStats");
                            RadTabStrip tsStats = (RadTabStrip)pnlBarStats.FindItemByValue("Statistics").FindControl("RadTabstrip1");
                            RadTab tab1 = tsStats.Tabs.FindTabByText("CAO Statistics");
                            tab1.Selected = true;
                        }
                    }
                }
            }
     
            //<!-- Begin Table Location Info -->
            private void FillKioskListGrid()
            {
                KioskInformation kioskInfo = new KioskInformation();
                Int32 locationCodeID = Convert.ToInt32(Session["LocationCodeID"]);
                using (DataSet dsKiosks = kioskInfo.GetExistingKioskList(locationCodeID))
                {
                    dsKiosks.Tables[0].DefaultView.Sort = "CUSTOMERNAME ASC";
                    gvKiosk.DataSource = dsKiosks.Tables[0].DefaultView;
                    gvKiosk.DataBind();
                }
            }
     
            protected void gvKiosk_ItemDataBound(object sender, GridItemEventArgs e)
            {
                if (e.Item is GridDataItem) //to access a row
                {
                    string loginUser = Session["User"].ToString();
                    LinkButton lnkCheckIn = (LinkButton)e.Item.FindControl("lnkCheckIn");
                    DataRowView row = (DataRowView)e.Item.DataItem;                               
                    string profileID = row["PROFILE_ID"].ToString();
                    if (!string.IsNullOrEmpty(row["USERNAME"].ToString()))
                    {
                        LinkButton lnkGotoAccount = (LinkButton)e.Item.FindControl("lnkGotoAccount");
     
                        if (loginUser.ToUpper() == (row["USERNAME"].ToString().ToUpper()))
                        {
                            lnkCheckIn.Visible = true;
                        }
                        else
                        {
                            lnkGotoAccount.Visible = false;
                        }
     
                        //If Current User Type is Super Admin then Check in Button is Visiable.
                        if (Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.SUPERADMIN) || Convert.ToInt32(Session["UserType"]) == Convert.ToInt32(cEnums.eUserType.INTADMIN))
                        {
                            lnkCheckIn.Visible = true;
                        }
                    }
     
                    if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
                    {
                        Control target = e.Item.FindControl("targetControl");
                        if (!Object.Equals(target, null))
                        {
                            if (!Object.Equals(this.RadToolTipManager1, null))
                            {
                                //Add the button (target) id to the tooltip manager
                                this.RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as GridDataItem).GetDataKeyValue("Profile_ID").ToString(), true);
     
                            }
                        }
                    }
                }
            }
     
            //<!-- End Table Location Info -->  
     
            protected void gvKiosk_ItemCommand(object sender, GridCommandEventArgs e)
            {
                if (e.CommandName == "GoToAccount")
                {
                    GridDataItem item = e.Item as GridDataItem;
     
                    string domainURL = Common.GetConfigurationSetting("PAMDomainUrl");
                    string caoUrl = domainURL.ToString() + Common.GetConfigurationSetting("CAOLoginURL");
                    string emailAddress = item["emailaddress"].Text;               
                    string dlNumber = item["driverslicenseno"].Text;               
                    Label lblBillingZip = (Label)item.FindControl("lblBillingZip");
                    string billingZip = lblBillingZip.Text.ToString();
                    string url = caoUrl + "?email=" + emailAddress + "&dl=" + dlNumber + "&ac=" + billingZip;
     
                    string scriptstring = "openRadWin('" + url + "');";
     
                    // In order for this functionality to work you have to follow these steps.  Click on the "Go To Account" link.
                    // You will see a window open and it should populate the username and other information automatically and log you
                    // into CAO.  When you are finished working in CAO you MUST log out of CAO.
     
                    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "radScript", scriptstring, true);
     
     
                    Label lblProfileID = (Label)item.FindControl("lblProfileID");
                    Int32 profileID = Convert.ToInt32(lblProfileID.Text.ToString());
                    Int32 userID = Convert.ToInt32(Session["UserID"].ToString());
     
                    try
                    {
                        KioskInformation kioskInfo = new KioskInformation();
                        kioskInfo.UpdateCheckOutStatus(profileID, userID);
     
                        Label lblSignup = (Label)item.FindControl("lblSignupStep");
                        string status = lblSignup.Text;
     
                        if (status == "PAYMENT APPLIED TO ACCOUNT")
                        {
                            Label lblPreAcctNo = (Label)item.FindControl("lblPreAccountNo");
                            Session["From"] = "Kiosk";          //HARD_CODED - we are coming from Kiosk
                            Session["PreAccountNo"] = lblPreAcctNo.Text;
                            Session["ProfileID"] = profileID;
                            Response.Redirect("CAOAssignTags.aspx", false);
                            HttpContext.Current.ApplicationInstance.CompleteRequest();
                        }
                        FillKioskListGrid();
                       HttpResponse.RemoveOutputCacheItem("/KioskList.aspx");
                    }
                    catch (Exception ex)
                    {
                        //If ReturnCode Return -990 means Needs to Refresh screen some one check out
                        if (!(ex.Message.Contains("-990") || ex.Message.Contains("-991")))
                        {
                            ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ss", "<script>alert('The tag request is currently checked out to another user.');</script>", false);
                        }
                        else
                        {
                            ErrorLogging logging = new ErrorLogging();
                            logging.callingPage = Request.Url.ToString();
                            logging.callingMethod = System.Reflection.MethodBase.GetCurrentMethod().Name;
                            ErrorLogging.LogError(ex, logging);
                        }
                    }
                }
                else if (e.CommandName == "CheckIn")
                {
                    GridDataItem item = e.Item as GridDataItem;
     
                    Label lblProfileID = (Label)item.FindControl("lblProfileID");
                    Int32 profileID = Convert.ToInt32(lblProfileID.Text.ToString());
                    CAOInformation.UpdateCheckInStatus(profileID);
                    FillKioskListGrid();
                }
                else if (e.CommandName == "Sort" || e.CommandName == "Page")
                {
                    RadToolTipManager1.TargetControls.Clear();
                }
            }
        }
    }
    Please help me!

    Thanks,
    Steve
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 18 Dec 2014 Link to this post

    Hello Shannon,

    This is caused by invalid server response and I advise that you step through the server code to see what changes the response, as instructed here: http://www.telerik.com/help/aspnet-ajax/tooltip-troubleshooting-common-issues.html#ServerErrorException.


    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Shannon
    Shannon avatar
    6 posts
    Member since:
    Sep 2013

    Posted 18 Dec 2014 in reply to Marin Bratanov Link to this post

    Thanks for the quick reply.  I understand that it is an invalid server response. Google gave me that information.  Can you look through my code and see if you see anything that may change the server state?
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3595 posts

    Posted 19 Dec 2014 Link to this post

    Hi Shannon,

    You should examine the actual response with a tool like Fiddler or the browser dev toolbar to see what is actually returned in order to get a bearing on what may be causing the problem.

    At this point, what I can see is that you have many nested AJAX settings - an UpdatePanel around everything, including RadAjaxPanel and RadAjaxManager. You should avoid nesting settings like this.

    Also, to AJAX-enable a RadWIndow, I advise that you examine this article, since a RadWindowManager or RadWIndow cannot be AJAX initiators: http://www.telerik.com/help/aspnet-ajax/window-ajaxifying.html.

    As for the server code - any Response.Redirect() call in Page_Load can break the response, but there is no way for me to know whether one will be executed, only you can debug that as I cannot run this sample.

    I cannot say anything about the custom classes you have and calls like CAOInformation.UpdateCheckInStatus(profileID);

    Thus, I cannot be of much assistance with this, even though I had reviewed the code the first time I replied because noticing the Response.Redirect() calls is something Google would have already pointed out.


    Regards,

    Marin Bratanov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top