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

Callback the first time, postbacks after that...

18 Answers 492 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jason Maronge
Top achievements
Rank 1
Jason Maronge asked on 25 Apr 2007, 02:07 PM
I am on my way to having my first "Prometheus" ajax page.  I switched out the RadAjaxPanel, LoadingPanel, added the RadCodeBlock to my JS section and the ScriptManager to the top of the page.  Now when I click a button on the page it does the ajax callback fine, but when I click it again it does a postback and does a postback any time thereafter.  It seems that only the first time a postback is performed does it do the callback.  

    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">  
    </asp:ScriptManager> 
    <telerik:RadCodeBlock ID="cb" runat="server">  
 
        <script language="javascript" type="text/javascript">  
        window.CalendarChanged = function(calendarInstance, args)  
        {  
            if (args.RenderDay.IsSelected)   
                return false;   
        }  
        window.GetTodaysDateSCH = function(){GetDateStamp(<%=this.txtDate.ClientID %>);}  
        </script> 
 
    </telerik:RadCodeBlock> 
    <telerik:RadAjaxLoadingPanel ID="alp" runat="server" IsSticky="true" MinDisplayTime="0" 
        HorizontalAlign="Center">  
        <asp:Image ID="Image2" runat="server" alt="loading..." ImageUrl="~/Images/Loading2.gif" /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="alp" EnableAJAX="true" 
        EnableHistory="true" EnablePageHeadUpdate="true">  
        <table> 
            <tr> 
                <td> 
                    <asp:Label ID="title" runat="server" Text="Schedule Search: " /> 
                    <radCln:RadDatePicker ID="txtDate" runat="server" SharedCalendarID="RadCalendar1" 
                        onkeypress="GetTodaysDateSCH();" MinDate="1/1/2000" OnSelectedDateChanged="txtDate_SelectedDateChanged">  
                        <DateInput Title="" ToolTip="Press 'd' for current date" AutoPostBack="true" UseEmbeddedScripts="false" 
                            DateFormat="MM/dd/yyyy">  
                        </DateInput> 
                    </radCln:RadDatePicker> 
                    <radCln:RadCalendar ID="RadCalendar1" runat="server" Skin="WebBlue" UseEmbeddedScripts="false">  
                        <ClientEvents OnDateClick="CalendarChanged" /> 
                    </radCln:RadCalendar> 
                    <asp:Button ID="cmdRefresh" runat="server" Text="Refresh" OnClick="cmdRefresh_Click" /> 
                </td> 
            </tr> 
        </table> 
        <radG:RadGrid ID="rg" runat="server" Style="width: 100%;" AutoGenerateColumns="False" 
            AllowSorting="True" GridLines="None" OnItemDataBound="rg_ItemDataBound" OnNeedDataSource="rg_NeedDataSource">  
            <MasterTableView GridLines="None">  
                <Columns> 
                    <radG:GridBoundColumn DataField="ID" ReadOnly="True" UniqueName="ID" Visible="False">  
                    </radG:GridBoundColumn> 
                    <radG:GridBoundColumn DataField="PatientEncounter_ID" ReadOnly="True" UniqueName="PatientEncounter_ID" 
                        Visible="False">  
                    </radG:GridBoundColumn> 
                    <radG:GridBoundColumn HeaderText="Time" UniqueName="Time" DataField="Time">  
                    </radG:GridBoundColumn> 
                    <radG:GridTemplateColumn HeaderText="Patient" UniqueName="patient" Groupable="False">  
                        <ItemTemplate> 
                            <asp:HyperLink ID="hlp" runat="server" Text='<%# DataBinder.Eval( Container, "DataItem.Patient") %>'></asp:HyperLink> 
                        </ItemTemplate> 
                    </radG:GridTemplateColumn> 
                    <radG:GridBoundColumn HeaderText="Account Number" UniqueName="AccountNumber" DataField="AccountNumber">  
                    </radG:GridBoundColumn> 
                    <radG:GridBoundColumn HeaderText="Procedure" UniqueName="ProcedureName" DataField="ProcedureName">  
                    </radG:GridBoundColumn> 
                    <radG:GridTemplateColumn UniqueName="TemplateColumnAdditionalProcedure" Groupable="False">  
                        <ItemTemplate> 
                            <asp:HyperLink ID="hl" runat="server" ImageUrl="~/Images/MedicalChart.gif"></asp:HyperLink> 
                        </ItemTemplate> 
                    </radG:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
            <AlternatingItemStyle BackColor="#ECECEC" /> 
        </radG:RadGrid> 
    </telerik:RadAjaxPanel> 
 



Thanks...  Jason

18 Answers, 1 is accepted

Sort by
0
Jason Maronge
Top achievements
Rank 1
answered on 25 Apr 2007, 03:19 PM
I switched my AjaxPanel to an AjaxManager and it seems to work fine.  Is there something I must do in the panel to get it to work?

Jason
0
Vlad
Telerik team
answered on 25 Apr 2007, 03:35 PM
Hello Jason,

We tried to replicate this however everything seems to work fine. You can find an example application attached.

All the best,
Vlad
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason Maronge
Top achievements
Rank 1
answered on 26 Apr 2007, 03:54 AM

I have created a test app successfully but can not seem to get my main app working.  I have tried adding an AjaxPanel to another page and I am getting the same result.  First time the callback, then after that it does a postback.  Interestingly it looks like it is not saving the ViewState because some of the items i check it in are not appearing after the postback.  they appear fine after the first callback though.

Any ideas on what I need to do to find out what is causing the problem? 

Thanks...  Jason

0
Vlad
Telerik team
answered on 26 Apr 2007, 07:47 AM
Hello Jason,

Are you using latest versions of the grid and calendar? If you can reproduce this - please send us small example demonstrating the problem.

Sincerely yours,
Vlad
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason Maronge
Top achievements
Rank 1
answered on 26 Apr 2007, 02:31 PM
I have figured out what is causing the problem.  I have 

<pages enableEventValidation="false">

in my web.config.  With this setting set to false you get the postback.  I have validated that it causes problems on the sample you have attached to this post.  I does act a little different though.  After the first callback it does a postback and then will do a callback and then a postback, etc.  It keeps flipping back and forth.

Jason

0
Jason Maronge
Top achievements
Rank 1
answered on 01 May 2007, 10:33 PM
I was wondering if anyone has figured out why the enableEventValidation set in the web.config makes the UpdatePanel not work?

Jason
0
Vlad
Telerik team
answered on 02 May 2007, 03:23 PM
Hi Jason,

Indeed you are right. We are trying to troubleshoot this however the problem is deeply in the ASP.NET AJAX core. Once we resolve this we will inform you immediately.

Greetings,
Vlad
the telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
sidney smith
Top achievements
Rank 1
answered on 04 May 2007, 04:45 PM
Awesome catch Jason!! wow you just saved me a ton of debuging!!
0
Matt
Top achievements
Rank 1
answered on 08 May 2007, 04:30 PM
This is interesting, because I cam getting the -exact- opposite results.

When I did my first page using Prometheus, everything on my first ajax callback worked fine, as soon as I do my 2nd ajax request, in my browerser I get a javascript alert with the following text:

"Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Pages EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManage.RegisterForEventsValidation method in order t register the postback or callback data for validation."

That alert pops up every time after the first ajax request.  If I set enableeventvalidation to false in my page directive for the page, everything appears to work exactly how I expect.  But I don;t believe i should be turning off event validation.

0
Konstantin Petkov
Telerik team
answered on 09 May 2007, 05:14 AM
Hello Matt,

Could you elaborate more? Any information on your scenario may be of help on resolving that.

Could you best isolate it in a sample and open a support ticket where you can send that? It will help us a lot in resolving the problem.

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Flemming Rosenbrandt
Top achievements
Rank 1
answered on 13 Jun 2007, 08:07 AM

Hi

I am having the same problem when wrapping content in a Prometheus ajaxpanel. First time is a callback, second is a postback, third time is a callback again.

It is only when using the Prometheus ajaxpanel – the standard Telerik ajaxpanel works fine.

I noticed that the Telerik Prometheus ajaxpanel demo has the same behaviour:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Ajax/Examples/Panel/FirstLook/DefaultCS.aspx

/Flemming Rosenbrandt

0
Konstantin Petkov
Telerik team
answered on 13 Jun 2007, 08:15 AM
Hi Flemming,

Indeed, this issue appears at the demo you pointed, but we believe it is already addressed . Next release (Service Pack 2) is expected in two weeks.

All the best,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Flemming Rosenbrandt
Top achievements
Rank 1
answered on 13 Jun 2007, 08:21 AM

Hi

I tried your demo again – and now it behaved correctly. Then I cleared my IE cache and tried again – and now it started the callback / postback thing again.

Sounds great about the SP2 coming up.

/Flemming Rosenbrandt

0
Jason Maronge
Top achievements
Rank 1
answered on 03 Aug 2007, 04:01 PM
I am still seeing this behavoir on my site and on your demo site.  Any more news on if/when this is going to be fixed?

Thanks,

Jason

BTW: I am using version 2007.1 626
0
Konstantin Petkov
Telerik team
answered on 04 Aug 2007, 01:41 PM
Hi Jason,

Prometheus Futures has been released at the beginning of July (7.05), but you will find attached the latest trial hotfix, which includes another postback issue fix as well.

One can find Prometheus Futures Online Demos here:

http://www.telerik.com/demos/aspnet/prometheus-futures/Ajax/Examples/Overview/DefaultCS.aspx

All the best,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason Maronge
Top achievements
Rank 1
answered on 05 Aug 2007, 02:24 AM
I am confused.  I have the latest version of Prometheus and am still seeing the problem.  Also the link you supplied does the postback. 


Jason
0
Konstantin Petkov
Telerik team
answered on 05 Aug 2007, 08:20 AM
Hello Jason,

The issue does not appear locally on our end with the hotfix I sent you. Can you please double-check that you have updated Telerik.Web.UI successfully? Would you point the exact demo where this can be observed?

Regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason Maronge
Top achievements
Rank 1
answered on 05 Aug 2007, 02:51 PM
I apologize, I did not apply the trial hotfix, but tried the sample link

http://www.telerik.com/demos/aspnet/prometheus-futures/Ajax/Examples/Overview/DefaultCS.aspx

and it still did not work.  I need a developer build of the hotfix so we can try it on our test servers.  I will open a support ticket if you can attached one to it. 

Thanks for your help,

Jason
Tags
Ajax
Asked by
Jason Maronge
Top achievements
Rank 1
Answers by
Jason Maronge
Top achievements
Rank 1
Vlad
Telerik team
sidney smith
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Konstantin Petkov
Telerik team
Flemming Rosenbrandt
Top achievements
Rank 1
Share this question
or