This is a migrated thread and some comments may be shown as answers.
RadAjaxManager does not update Controls when fired throug ajaxRequest()
10 Answers 271 Views
This is a migrated thread and some comments may be shown as answers.
Philip
Top achievements
Rank 1
Philip asked on 17 Apr 2008, 06:43 PM
Hello,

I have following scenario:
A Panel with default Button within, Textbox and a Literal that should be updated through AjaxManager. If I click on the button, the Literal is updated. But if I press enter the client function is fired as well as the serverside event, but the Literal is not updated. Strange, isn't it?

Do I miss something or is this a bug? I use the latest trial version of your ASP.NET AJAX Controls.

ASPX-Markup
<asp:Panel ID="Panel1" runat="server" DefaultButton="ButtonShowDateTime"
    <asp:Literal ID="LiteralDateTime" runat="server"></asp:Literal> 
 
    <telerik:RadTextBox ID="RadTextBox1" runat="server"></telerik:RadTextBox> 
     
    <asp:Button ID="ButtonShowDateTime" runat="server" Text="Show me!" 
        OnClientClick="ButtonShowDateTime_Click(); return false;" /> 
</asp:Panel> 
 
<telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server" OnAjaxRequest="RadAjaxManagerMain_AjaxRequest"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManagerMain"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="LiteralDateTime" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager>   
 
<script type="text/javascript" language="javascript"
    function ButtonShowDateTime_Click() 
    { 
        alert("client cutton_click was fired"); 
        $find("<%=RadAjaxManagerMain.ClientID%>").ajaxRequest("Save"); 
    } 
</script> 
 

Code Behind
protected void RadAjaxManagerMain_AjaxRequest(object sender, AjaxRequestEventArgs e) 
    LiteralDateTime.Text = DateTime.Now.ToString(); 

Thank you very much and with kind regards,

Philip

10 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 18 Apr 2008, 07:30 AM
Hi Philip,

The code functions exactly as expected on my end. Attached, you will find a sample web site following your scenario. Let me know if I am missing something out.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
lawanya
Top achievements
Rank 1
answered on 18 Apr 2008, 03:31 PM
I use the latest prometheus version of RadAjaxManager and onajaxrequest event is not fired. It would be wonderful if you can post Prometheus version of it.

Thanks,
Lawanya
0
Konstantin Petkov
Telerik team
answered on 18 Apr 2008, 03:35 PM
Hello lawanya,

The project I've attached in my previous response functions properly with the latest version labeled 1_415 (RadControls for ASP.NET AJAX official version). Let us know if we are missing something.

Regards,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Philip
Top achievements
Rank 1
answered on 18 Apr 2008, 03:50 PM
Hi Konstantin,

I tried your attached Code and it worked properly. But I used it on an other Computer. In a more complex scenario it still doesn't work. On Monday I will try your code on my other machine and try to figure out what causes this strange behavior.

Philip
0
Philip
Top achievements
Rank 1
answered on 21 Apr 2008, 07:12 AM
Konstantin,

I see that you use .NET 2.0 in your example app. Please try to use 3.5. It seems that my described scenario appears only with .NE 3.5.

Greetings,

Philip
0
Konstantin Petkov
Telerik team
answered on 21 Apr 2008, 11:29 AM
Hello Philip,

I was able to reproduce the problem in FW 3.5 and we will investigate the problem as soon as possible. Thank you for reporting it!

Greetings,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Steele
Top achievements
Rank 1
answered on 23 Apr 2008, 10:00 PM
I am having basically the same problem, however mine only stops working on a particular IIS6 server.  but it is not a case of Return vs. Tab neither works.and I have no button to force the action, it is firing from onchanged of a textbox.

Works fine in Cassini, works Fine in IIS7 but when installed on an IIS6 Server it stops updating.  The event fires, the postback happens, but noting gets returned. (and nothing changes on the server, I am setting a Session variable and it does not get updated.

I can't debug it because when I ue a debugger on a different IIS6 machine, it works fine... This problem is making me crazy and it's making my client think I am an idiot :-/

Obviously in my case I think it must be a missing dll or IIS setting, but I swear I have copy and pasted everything so it is identical on different machines.  I even exported/imported the Website config for IIS... one machine works, one doesn't.
0
Konstantin Petkov
Telerik team
answered on 24 Apr 2008, 08:15 AM
Hello,

We have investigated the problem initially reported in this ticket and were able to identify the source. It appears that the DefaultButton doesn't work with MS AJAX the same way as in the previous FW 2.0 version. The problem here is that you cannot trigger AJAX update from another control (text box in this case) when a default button is set. The MS AJAX simply ignores the other requests and the RaisePostBackEvent (AjaxRequest in case of RadAjaxManager) is not fired.

I have attached a sample 3.5 web site, which demonstrates the problem with standard UpdatePanel. You can remove//comment the UpdatePanel and see the RaisePostBackEvent fired.

The easiest way to work around the problem would be to remove the DefaultButton of the Panel. I verified it works properly on my end.

I hope this helps!

Best wishes,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Philip
Top achievements
Rank 1
answered on 28 Apr 2008, 10:01 AM
Konstantin,

thank you for your reply. You wrote that an AJAX update cannot be triggered from another control when a default button is set. But: the default button triggers a Javascript function that again triggers the ajaxRequest. I could see the Javascript function is fired as well as the code behind ajaxRequest. BUT: the controls modified in code behind are not updated.

Removing the default button is not a solution because we use multiple buttons on our pages.

Do you have any ideas?

Greetings,
Philip
0
Konstantin Petkov
Telerik team
answered on 29 Apr 2008, 11:54 AM
Hi Philip,

Unfortunately, as I mentioned earlier, the MS AJAX implementation in FW 3.5 does not allow the AjaxRequest to be fired in case of DefaultButton.

The other option would be to forget the AjaxRequest and try the ajaxRequestWithTarget function specifying the default button as target. You need to hook the Button_Click event this way. The client-side function is explained in details in RadAjax Client-Side API help article.

Sincerely yours,
Konstantin Petkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
Philip
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
lawanya
Top achievements
Rank 1
Philip
Top achievements
Rank 1
Steele
Top achievements
Rank 1
Share this question
or