Welcome Guest Search | Active Topics | Sign In | Register

Error on callback panel during postback Options
Darrell Reinke
Posted: Thursday, August 20, 2009 3:13:56 PM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
I have a simple scenario using your callback panel that I need assistance on. I have an ASPX page with the following objects (I kept the page simple, it actually has a menu that drives the changing of the panel through Javascript with *.ASCX pages) I know you support running a callbackpanel within a callbackpanel, but was wondering if I am missing some syntax somewhere that is causing my problem?

Code: JavaScript
function changeView(asType){
      eo_Callback('<%=cbpLMS.ClientID%>', asType);
    } //END function changeView(asType){


Code: HTML/ASPX
<table cellspacing="0" cellpadding="0" border="0">
                           <tr>
                              <td>
                                 <eo:CallbackPanel ID="cbpLMS" runat="server" AutoDisableContents="True">
                                    <asp:Panel ID="pnlNav" runat="server">
                                    </asp:Panel>
                                 </eo:CallbackPanel>
                              </td>
                           </tr>
                        </table>


VB Code to load pnlNav:
Code: Visual Basic.NET
Protected Sub cbpLMS_Execute(ByVal sender As Object, ByVal e As EO.Web.CallbackEventArgs) Handles cbpLMS.Execute
      Dim sTab As String = e.Parameter

      Try


         Select Case sTab
            Case "Other ASCX panels to load"
            Case "ASSIGN"

               Dim pControl As lmsClassAssignment
               pControl = CType(Page.LoadControl("lmsClassAssignment.ascx"), lmsClassAssignment)

               EO.Web.Runtime.ResetState(pControl)

               Dim wControl As System.Web.UI.Control = pControl
               pnlNav.Controls.Clear()
               pnlNav.Controls.Add(wControl)

         End Select

      Catch exLoad As Exception
         Session("ERROR") = "Error in application (LMS.aspx--cbpLMS_Execute):  " + exLoad.Message.Trim
         Session("DTLERROR") = exLoad.ToString.Trim
         Response.Redirect("lmsErrorPage.aspx")
      End Try
   End Sub


This is working as designed, however, when I pull up the *.ASCX within pnlNav and try and perform an eo_Callback within its page I get: EO.Web.Control 'ctl03_cbpAssign' error message: The callback failed because the server did not recognize this callback and processed it as an normal request......

Here are the controls in the *.ascx page.
Code: JavaScript
<script language="javascript" type="text/javascript"cmt:f80a415d-579a-46af-b00e-f85d6310e06f--
      function clearText(){
         document.getElementById("&lt;%=txtSearch.ClientID%&gt;").value ="";
      } //END function clearText(){
      
      function searchLookup(txtS){

         var txtSearch = document.getElementById("&lt;%=txtSearch.ClientID%&gt;");
         var lbLookUp = document.getElementById("&lt;%=lbJobs.ClientID%&gt;");
         
         //Loop Through List box and Highlight the Found Text
         if (txtSearch.value.length > 0){
            for (var i = 0; i < lbLookUp.options.length; i++)
             {
               //alert(dropDownBox.options[i].value + ' ' + cellValue);
		         if (lbLookUp.options[i].text.indexOf(txtSearch.value) >= 0)
		         {
		            lbLookUp.options[i].selected = true;
		            //After the 
		            break;
		         }          
             } //END for (var i = 0; i &lt; lbLookUp.options.length; i++)
          } //END if (txtSearch.value.length &gt; 0){
      } //END function searchLookup(txtSearch){

      function showAssignments(lbJobList) {
         if (lbJobList.value.length > 0) {
            var sValue = "JOBSWITCH@" + lbJobList.value;
            eo_Callback("&lt;%=cbpAssign.ClientID%&gt;", sValue);
            //eo_Callback("cbpAssign", sValue);
         } //END if (lbJobList.value.length &gt; 0) {
      } //END function showAssignments(lbJobList){
      
</script>

Code: HTML/ASPX
<table cellpadding="0" cellspacing="0" border="0">
   <tr>
      <td>
         <eo:Menu ID="mnuAssignments" runat="server" CheckIconUrl="OfficeCheckIcon2" ControlSkinID="None" Width="99%">
            <LookItems>
               <eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;color:gray" Height="24" HoverStyle-CssText="background-color:#C0D6F4;border-bottom-color:#000080;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#000080;border-left-style:solid;border-left-width:1px;border-right-color:#000080;border-right-style:solid;border-right-width:1px;border-top-color:#000080;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;"
                  ItemID="_TopLevelItem" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:5px;padding-right:5px;padding-top:1px;" SelectedStyle-CssText="background-color:white;border-bottom-color:#000080;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#000080;border-left-style:solid;border-left-width:1px;border-right-color:#000080;border-right-style:solid;border-right-width:1px;border-top-color:#000080;border-top-style:solid;border-top-width:1px;padding-left:4px;padding-right:4px;padding-top:0px;padding-bottom:0px;">
                  <SubMenu CollapseEffect-Type="GlideTopToBottom" ExpandEffect-Type="GlideTopToBottom" ItemSpacing="3" LeftIconCellWidth="25" SideImage="Office2003SideBar2" Style-CssText="background-color:#F6F6F6;border-bottom-color:#002D96;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#002D96;border-left-style:solid;border-left-width:1px;border-right-color:#002D96;border-right-style:solid;border-right-width:1px;border-top-color:#002D96;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
                  </SubMenu>
               </eo:MenuItem>
               <eo:MenuItem IsSeparator="True" ItemID="_Separator" NormalStyle-CssText="background-color:#6a8ccb;height:1px;margin-left:30px;width:1px;">
               </eo:MenuItem>
               <eo:MenuItem DisabledStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;color:gray" Height="24" HoverStyle-CssText="background-color:#FFEEC2;border-bottom-color:#000080;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#000080;border-left-style:solid;border-left-width:1px;border-right-color:#000080;border-right-style:solid;border-right-width:1px;border-top-color:#000080;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
                  ItemID="_Default" NormalStyle-CssText="background-color:transparent;border-bottom-style:none;border-left-style:none;border-right-style:none;border-top-style:none;padding-bottom:1px;padding-left:2px;padding-right:5px;padding-top:1px;" SelectedStyle-CssText="background-color:white;border-bottom-color:#000080;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#000080;border-left-style:solid;border-left-width:1px;border-right-color:#000080;border-right-style:solid;border-right-width:1px;border-top-color:#000080;border-top-style:solid;border-top-width:1px;padding-left:1px;padding-right:4px;padding-top:0px;"
                  Text-Padding-Right="30">
                  <SubMenu CollapseEffect-Type="GlideTopToBottom" ExpandEffect-Type="GlideTopToBottom" ItemSpacing="3" LeftIconCellWidth="25" SideImage="Office2003SideBar2" Style-CssText="background-color:#F6F6F6;border-bottom-color:#002D96;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#002D96;border-left-style:solid;border-left-width:1px;border-right-color:#002D96;border-right-style:solid;border-right-width:1px;border-top-color:#002D96;border-top-style:solid;border-top-width:1px;color:black;cursor:hand;font-family:Tahoma;font-size:8pt;padding-bottom:1px;padding-left:1px;padding-right:1px;padding-top:1px;">
                  </SubMenu>
               </eo:MenuItem>
            </LookItems>
            <TopGroup Style-CssText="background-color:#6f99c2;">
               <Items>
                  <eo:MenuItem LeftIcon-Url="~/Images/save.gif" Text-Html="Save">
                  </eo:MenuItem>
                  <eo:MenuItem CustomItemID="ciStatus" Text-Html="&nbsp;&nbsp;&nbsp;" Visible="false">
                  </eo:MenuItem>
               </Items>
            </TopGroup>
         </eo:Menu>
         <eo:CustomItem ID="CustomItem1" runat="server" Width="200px">
            <asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Names="Calibri" Font-Size="Small" ForeColor="White" Height="24"></asp:Label>
         </eo:CustomItem>
      </td>
   </tr>
   <tr>
      <td>
         <table cellpadding="0" cellspacing="0" border="0">
            <tr>
               <td>
                  <img src="Images/spacer.gif" alt="" style="width: 5px" />
               </td>
               <td>
                  <table cellpadding="0" cellspacing="0" border="0">
                     <tr>
                        <td valign="top">
                           <table cellpadding="0" cellspacing="0" border="0">
                              <tr>
                                 <td>
                                    <table cellpadding="0" cellspacing="0" border="0" style="font-family: Tahoma; font-size: xx-small;">
                                       <tr>
                                          <td>
                                             <asp:Label ID="lblLookup" runat="server" Text="Search:&nbsp;&nbsp;" Style="font-weight: 700"></asp:Label>
                                          </td>
                                          <td>
                                             <asp:TextBox ID="txtSearch" onkeyup="javascript:searchLookup(this);" onBlur="javascript:searchLookup(this);" runat="server" Font-Names="tahoma" Font-Size="XX-Small" Width="180px"></asp:TextBox>
                                          </td>
                                          <td>
                                               <input id="btnClear" onclick="javascript:clearText();" style="font-family: Tahoma; font-size: xx-small; height: 17px; width: 53px;" type="button" value="Clear" />
                                          </td>
                                       </tr>
                                       <tr>
                                          <td>
                                              
                                          </td>
                                          <td align="center">
                                             <asp:Label ID="lblLookup0" runat="server" Text="(Search is Case Sensitive)" Style="font-weight: 700" Font-Bold="False" Font-Names="tahoma" Font-Size="XX-Small" ForeColor="Blue"></asp:Label>
                                          </td>
                                          <td>
                                          </td>
                                       </tr>
                                    </table>
                                 </td>
                              </tr>
                              <tr>
                                 <td>
                                    <asp:ListBox ID="lbJobs" runat="server" Font-Names="Tahoma" Font-Size="XX-Small" Height="418px" Width="285px"></asp:ListBox>
                                 </td>
                              </tr>
                              <tr>
                                 <td>
                                    <img src="Images/spacer.gif" alt="" style="height: 3px" />
                                 </td>
                              </tr>
                           </table>
                        </td>
                        <td>
                           <img src="Images/spacer.gif" alt="" style="width: 5px" />
                        </td>
                        <td valign="top">
                           <eo:CallbackPanel ID="cbpAssign" runat="server" AutoDisableContents="True">
                           <table cellpadding="0" cellspacing="0" border="0">
                              <tr>
                                 <td>
                                    <eo:Grid ID="grdClass" runat="server" BorderColor="#C7D1DF" BorderWidth="1px" ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304" ColumnHeaderDividerImage="00050302" FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="XX-Small" Font-Strikeout="False" Font-Underline="False" GridLineColor="199, 209, 223" Height="335px" ItemHeight="19" Width="415px">
                                       <FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
                                       <ItemStyles>
                                          <eo:GridItemStyleSet>
                                             <ItemStyle CssText="background-color: white" />
                                             <ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
                                             <SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
                                             <CellStyle CssText="padding-left:8px;padding-top:2px; color:#336699;white-space:nowrap;" />
                                          </eo:GridItemStyleSet>
                                       </ItemStyles>
                                       <ColumnTemplates>
                                          <eo:TextBoxColumn>
                                             <TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
                                          </eo:TextBoxColumn>
                                          <eo:DateTimeColumn>
                                             <DatePicker ControlSkinID="None" DayCellHeight="16" DayCellWidth="19" DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True" SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL" TitleRightArrowImageUrl="DefaultSubMenuIcon">
                                                <TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
                                                <SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                                <DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                                <PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
                                                <CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
                                                <TitleArrowStyle CssText="cursor:hand" />
                                                <DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
                                                <MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
                                                <TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
                                                <OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                                <DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
                                                <DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
                                             </DatePicker>
                                          </eo:DateTimeColumn>
                                          <eo:MaskedEditColumn>
                                             <MaskedEdit ControlSkinID="None" TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
                                             </MaskedEdit>
                                          </eo:MaskedEditColumn>
                                       </ColumnTemplates>
                                       <Columns>
                                          <eo:RowNumberColumn Width="0">
                                          </eo:RowNumberColumn>
                                          <eo:CustomColumn Width="10">
                                          </eo:CustomColumn>
                                          <eo:StaticColumn HeaderText="Class Name" Name="class_name" Width="180">
                                          </eo:StaticColumn>
                                          <eo:StaticColumn HeaderText="Credits" DataField="class_credits" Width="55">
                                          </eo:StaticColumn>
                                          <eo:StaticColumn HeaderText="Status" Name="Status" DataField="class_req_nm" Width="150">
                                          </eo:StaticColumn>
                                       </Columns>
                                       <ColumnHeaderStyle CssText="background-image:url('00050301');padding-left:8px;padding-top:2px;font-weight: bold;color:white;" />
                                    </eo:Grid>
                                 </td>
                              </tr>
                              <tr>
                                 <td>
                                    <img src="Images/spacer.gif" alt="" style="width: 5px" />
                                 </td>
                              </tr>
                              <tr>
                                 <td>
                                    <table cellpadding="0" cellspacing="0" border="0" style="font-family: Tahoma; font-size: xx-small">
                                       <tr>
                                          <td>
                                             <asp:Label ID="lblInfo1" runat="server" Text="Class Status:" Width="155px" Style="text-align: center"></asp:Label>
                                          </td>
                                          <td>
                                             <asp:DropDownList ID="ddlClassStatus" runat="server" Font-Names="tahoma" Font-Size="XX-Small" Width="135px">
                                                <asp:ListItem Value="X">--Not Set--</asp:ListItem>                                             
                                                <asp:ListItem>Continuing Education</asp:ListItem>
                                                <asp:ListItem>Elective</asp:ListItem>
                                                <asp:ListItem>Required</asp:ListItem>
                                                <asp:ListItem>Not Required</asp:ListItem>
                                                <asp:ListItem>Student Lving Required</asp:ListItem>
                                             </asp:DropDownList>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td>
                                             <asp:Label ID="lblInfo2" runat="server" Text="Does the Job require that this class is taken multiple times?" Width="155px" Style="text-align: center"></asp:Label>
                                          </td>
                                          <td align="center">
                                             <asp:RadioButtonList ID="rbMultipleTimes" runat="server" Font-Names="tahoma" Font-Size="XX-Small" RepeatDirection="Horizontal">
                                                <asp:ListItem Value="Y">Yes</asp:ListItem>
                                                <asp:ListItem Selected="True" Value="N">No</asp:ListItem>
                                             </asp:RadioButtonList>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td>
                                             <asp:Label ID="lblInfo3" runat="server" Text="Time frame between each class (In Months)" Width="152px" Style="text-align: center"></asp:Label>
                                          </td>
                                          <td align="center">
                                             <eo:MaskedEdit ID="meTimeFrameBetween" runat="server" Width="25">
                                                <eo:MaskedEditSegment IsRequired="True" MaxValue="48" SegmentType="Number" />
                                             </eo:MaskedEdit>
                                          </td>
                                       </tr>
                                       <tr>
                                          <td>
                                             <asp:Label ID="lblInfo4" runat="server" Text="Time frame class must be completed after hiring (In Months)" Width="113px" Style="text-align: center"></asp:Label>
                                          </td>
                                          <td align="center">
                                             <eo:MaskedEdit ID="meCompletedTime" runat="server" Width="25">
                                                <eo:MaskedEditSegment IsRequired="True" MaxValue="48" SegmentType="Number" />
                                             </eo:MaskedEdit>
                                          </td>
                                       </tr>
                                    </table>
                                 </td>
                              </tr>
                           </table>
                           </eo:CallbackPanel>   
                        </td>
                     </tr>
                  </table>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>
Darrell Reinke
Posted: Thursday, August 20, 2009 3:17:53 PM
Rank: Advanced Member
Groups: Member

Joined: 7/18/2008
Posts: 76
I meant to attach the Javascript for the ASCX page. The function "showAssignments(lbJobList)" is assigned to the onclick event within vb.net code on the initial pageload.

Code: JavaScript
function clearText(){
         document.getElementById("&lt;%=txtSearch.ClientID%&gt;").value ="";
      } //END function clearText(){
      
      function searchLookup(txtS){

         var txtSearch = document.getElementById("&lt;%=txtSearch.ClientID%&gt;");
         var lbLookUp = document.getElementById("&lt;%=lbJobs.ClientID%&gt;");
         
         //Loop Through List box and Highlight the Found Text
         if (txtSearch.value.length > 0){
            for (var i = 0; i < lbLookUp.options.length; i++)
             {
               //alert(dropDownBox.options[i].value + ' ' + cellValue);
		         if (lbLookUp.options[i].text.indexOf(txtSearch.value) >= 0)
		         {
		            lbLookUp.options[i].selected = true;
		            //After the 
		            break;
		         }          
             } //END for (var i = 0; i &lt; lbLookUp.options.length; i++)
          } //END if (txtSearch.value.length &gt; 0){
      } //END function searchLookup(txtSearch){

      function showAssignments(lbJobList) {
         if (lbJobList.value.length > 0) {
            var sValue = "JOBSWITCH@" + lbJobList.value;
            eo_Callback("&lt;%=cbpAssign.ClientID%&gt;", sValue);
            //eo_Callback("cbpAssign", sValue);
         } //END if (lbJobList.value.length &gt; 0) {
      } //END function showAssignments(lbJobList){
eo_support
Posted: Thursday, August 20, 2009 6:30:38 PM
Rank: Administration
Groups: Administration

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

Check whether you have reloaded the control that you dynamically loaded when the page posts back. While ASP.NET saves control property values with view state and restore them for you, it won't save the control you dynamically added to the page for you. So for example if you append some text to a Label control when a Button is clicked, clicking the button multiple times you will see the text for the Label keep growing. However if you append a new Label control to the form when a Button is clicked, you will never see the page gets two or more labels. This is because the Label that you dynamically created previously is lost when the page is posted back again.

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.