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

Ajax manager not working as expected

5 Answers 113 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 2
Bill asked on 12 Jan 2011, 10:41 PM
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();
        }

5 Answers, 1 is accepted

Sort by
0
Bill
Top achievements
Rank 2
answered on 15 Jan 2011, 02:46 AM
Telerik, any answers on this one yet???
0
Iana Tsolova
Telerik team
answered on 17 Jan 2011, 03:17 PM
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.
0
Bill
Top achievements
Rank 2
answered on 18 Jan 2011, 12:00 AM
It is declaratively added on the aspx page.
0
Iana Tsolova
Telerik team
answered on 19 Jan 2011, 04:28 PM
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.
0
Bill
Top achievements
Rank 2
answered on 20 Jan 2011, 11:32 PM
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.
Tags
Ajax
Asked by
Bill
Top achievements
Rank 2
Answers by
Bill
Top achievements
Rank 2
Iana Tsolova
Telerik team
Share this question
or