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

Ajax manager post back issue.

4 Answers 81 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 04 Aug 2011, 12:59 PM
Hi,

Can you tell me why I can never get the Rad ajax manager to work properly? Everytime I've attempted to use this feature it only partially works. Everything seems to work fine except there is still a postbackto causing my browser to refresh. Is there somthing i'm down wrong?I was under the impression that using this feature will allow me to update a control without the postback, am I wrong? Here's the aspx , followed by the c#
<div id="StatusWrapper">
                <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
                    <ClientEvents OnResponseEnd="OnResponseEnd" OnRequestStart="OnRequestStart"></ClientEvents>
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="btnMakeActive">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                        <telerik:AjaxSetting AjaxControlID="BtnSend">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="lblStatus" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <div id="Status">
                    Status:
                        <asp:Label ID="lblStatus" runat="server" Text="Active"></asp:Label>
                </div>
            </div>
protected void btnMakeActive_Click1(object sender, EventArgs e)
   {
       string currentStatus = Staff.GetStaffStatus(id);
       string status = string.Empty;
 
       if (currentStatus == "Active")
           status = "Inactive";
       if (currentStatus == "Inactive")
           status = "Active";
       Staff.UpdateStatus(id, status);
 
       lblStatus.Text = status;
   }

4 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 04 Aug 2011, 01:13 PM
Hello Ron,

I don't see any issue with your code. What are doing in the OnRequestStart client-side event, perhaps that is the issue.
0
Ron
Top achievements
Rank 1
answered on 04 Aug 2011, 02:18 PM
The OnRequestStart client-side event is not significant. I was just using it as a test to see if it was called.
I setup that function as well as the OnRequestEnd but neither were called. Which further explains that something is wrong, correct?
0
Kevin
Top achievements
Rank 2
answered on 04 Aug 2011, 05:42 PM
I guess my other questions would be:

 

  1.  Is this page using a master page? If so, do you have a RadAjaxManage control on the master page?
  2. Where is the btnMakeActive button located on the page, is it within another control? Is it a RadButton?

If you have a RadAjaxManager on your master, if you're using one, you should be using the RadAjaxManagerProxy on your content pages.

If you using an older version of the RadButton, you needed to set UseSubmitBehaviour to false to get it to work with ajax.

0
Ron
Top achievements
Rank 1
answered on 04 Aug 2011, 08:02 PM

The button is within a panel control, below is the script.

<asp:Panel ID="PanelViewInvoiceButtons" CssClass="ButtonsContainer" runat="server">
            <div style="width:435px; height:100%; float:left"></div>
            <div style="width:513px; position:relative; left:0px; top: 0px; float:left" >
                <asp:Button ID="btnEdit" runat="server" CssClass="Buttons" Text="Edit" onclick="btnEdit_Click" 
                     /> 
                <asp:Button ID="btnDelete" runat="server" CssClass="Buttons" Text="Delete" 
                    OnClientClick="return DeleteUser()"  /> 
                <asp:Button ID="btnEmail" runat="server" Text="Email" CssClass="Buttons" onclick="btnEmail_Click" 
                     /> 
                <asp:Button ID="btnChangeRole" runat="server" Text="Change Role" 
                    CssClass="Buttons" onclick="btnChangeRole_Click" /> 
                <asp:Button ID="btnMakeActive" runat="server" Text="Make Inactive" 
                    CssClass="Buttons"  onclick="btnMakeActive_Click1" /> 
                <asp:Button ID="BtnSend" runat="server" Text="Send Email" 
                    CssClass="Buttons" onclick="BtnSend_Click"  />
            </div>
        </asp:Panel>
Tags
Ajax
Asked by
Ron
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Ron
Top achievements
Rank 1
Share this question
or