Ajax manager not working as expected

6 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 12 Jan 2011 Link to this post

    I have a listbox that I set up to simply reload the data from the code behind based on a selection change to a radio button. It is performing the reload properly, but I'm seeing the page actually "reload" or "flicker" when it executes instead of doing it seemlessly.

    I have used the AjaxManager fine with other projects in the past and works as expected. However, I have used it in aspx pages that didn't have a masterpage attached to it with no problem. I am using it now inside a user control within an aspx page. That aspx page has a master page associated with it that already contains the RadScriptManager, so I obvioulsy can't put it inside my user control; otherwise I'd get the msg that I can only have 1 script manager tag.

    Could you please let me know what I'm doing incorrectly in this scenario? See the boldfacing for clarity...

    Here is my html which is in a user control:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="lstPatientEDLogs">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstPatientEDLogs" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <table cellpadding="1" cellspacing="1" width="100%">
        <tr>
            <td>
                <asp:Panel ID="pnlData" runat="server" GroupingText="Data Type" Width="1100px">
                    <asp:RadioButtonList ID="rblDataType" RepeatDirection="Horizontal" TextAlign="Right"
                        runat="server" Width="100%" AutoPostBack="true" OnSelectedIndexChanged="rblDataType_SelectedIndexChanged">
                        <asp:ListItem Text="Chart ==> Demographics" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Patient ==> Coding"></asp:ListItem>
                    </asp:RadioButtonList>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Panel ID="pnlDate" runat="server" ScrollBars="Horizontal" GroupingText="Date Filter">
                    <table>
                        <tr>
                            <td>
                                Date Of Service:
                            </td>
                            <td>
                                <asp:ListBox ID="lstPatientEDLogs" runat="server" Rows="1"></asp:ListBox>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>

    Here is my code behind:

    private void LoadDatesofSvc()
            {
                lstPatientEDLogs.Items.Clear();

                if (rblDataType.SelectedItem.Text == "Patient ==> Coding")
                {
                    var query = DbContext.SelectPatientEDLogs();

                    string strDate = "";
                    foreach (var q in query)
                    {
                        DateTime dt = q.DateOfService ?? DateTime.Now;
                        strDate = dt.ToString("MM/dd/yyyy");

                        lstPatientEDLogs.Items.Add(new ListItem(strDate, strDate));
                    }
                    lstPatientEDLogs.Items.Insert(0, "");
                }
                else if (rblDataType.SelectedItem.Text == "Chart ==> Demographics")
                {
                    var query = DbContext.SelectEDLogs();

                    string strDate = "";
                    foreach (var q in query)
                    {
                        DateTime dt = q.DateOfService ?? DateTime.Now;
                        strDate = dt.ToString("MM/dd/yyyy");

                        lstPatientEDLogs.Items.Add(new ListItem(strDate, strDate));
                    }
                    lstPatientEDLogs.Items.Insert(0, "");
                }
            }

           
            protected void rblDataType_SelectedIndexChanged(Object sender, EventArgs e)
            {
                LoadDatesofSvc();
            }

  2. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 14 Jan 2011 Link to this post

    Telerik, any answers on this one yet???
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 17 Jan 2011 Link to this post

    Hello William,

    The provided code is properly defined. However can you specify if the user control is loaded dynamically or is declaratively added on the aspx page?

    Regards,
    Iana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 17 Jan 2011 Link to this post

    It is declaratively added on the aspx page.
  6. Iana Tsolova
    Admin
    Iana Tsolova avatar
    3388 posts

    Posted 19 Jan 2011 Link to this post

    Hi William,

    Can you try modifying the settings as below:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rblDataType">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lstPatientEDLogs" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>


    Greetings,
    Iana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  7. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 20 Jan 2011 Link to this post

    Iana, that worked fine, thanks...

    That was a silly mistake on my part. I had the AjaxControlID set to the incorrect control. I should have caught it.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017