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

Full postback when refreshing from RadWindow OnClientClose

6 Answers 118 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
RichJ
Top achievements
Rank 1
RichJ asked on 28 Mar 2012, 03:37 AM

Hi all,
I have a user control that contains a RadAjaxManagerProxy configured thus:

<telerik:RadAjaxManagerProxy ID="radajaxmanagerproxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="linkRefreshCCCLogos">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="rCCCLogos" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>

I have a repeater that is to be refreshed when a record is edited via RadWindow, which in turn triggers a postback OnClientClose against a hidden linkbutton: (refreshPage is the function I've assigned to OnClientClose, and it does get called and passes the correct argument to refreshBrandingOptions)...

<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script language="javascript" type="text/javascript">
 
        function refreshPage(sender, args) {
            if (args.get_argument() != null) {
                refreshBrandingOptions(args.get_argument());
            } else { }
        }
 
        function refreshBrandingOptions(ElementTypeID) {
            switch (ElementTypeID) {
                case 52:
                    // __doPostBack('linkRefreshCCCLogos', '');
                    break;
                case 1:
                    __doPostBack('linkRefreshAssets', '');
                    break;
                default:
                    alert('Trying to refresh for ElementTypeID: ' + ElementTypeID);
                    //Do nothing
            }
        }
    </script>
</telerik:RadScriptBlock>

If the OnClientClose function is called and triggers the postback, the whole page refreshes.
If I add some dummy text to the linkbutton, stop the OnClientClose event from firing and then manually click the linkbutton, the repeater updates via ajax as it should.

The linkbutton and repeater code:

<asp:LinkButton ID="linkRefreshCCCLogos" runat="server" Text="dddd"></asp:LinkButton>
<div class="titleDiv" style="padding-left: 24px;">
    <asp:Repeater ID="rCCCLogos" runat="server">
        <HeaderTemplate>
            <div style="height: 10px;">
            </div>
            <div class="defaultText" style="width: 100px; display: inline-block; font-weight: bold;">
                Process</div>
            <div class="defaultText" style="width: 180px; display: inline-block; font-weight: bold;">
                Asset Name</div>
            <div class="defaultText" style="width: 140px; display: inline-block; font-weight: bold;">
                Position</div>
            <div class="defaultText" style="width: 120px; display: inline-block; font-weight: bold;">
                Size</div>
            <div class="defaultText" style="width: 170px; display: inline-block; font-weight: bold;">
                Colour</div>
            <div class="defaultText" style="width: 170px; display: inline-block; font-weight: bold;">
                Colour 2</div>
            <div class="defaultText" style="width: 16px; display: inline-block;">
            </div>
            <div class="defaultText" style="width: 16px; display: inline-block;">
            </div>
            <br />
        </HeaderTemplate>
        <ItemTemplate>
            <asp:Label ID="lblOrderGarmentBrandingID" runat="server" Visible="false" Text=' <%# DataBinder.Eval(Container.DataItem, "OrderGarmentBrandingID")%>'></asp:Label>
            <div class="defaultText" style="width: 100px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "ProcessName")%></div>
            <div class="defaultText" style="width: 180px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "AssetName")%></div>
            <div class="defaultText" style="width: 140px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "PositionName")%></div>
            <div class="defaultText" style="width: 120px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "SizeName")%></div>
            <div class="defaultText" style="width: 170px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "Colour1Name")%></div>
            <div class="defaultText" style="width: 170px; display: inline-block;">
                <%# DataBinder.Eval(Container.DataItem, "Colour2Name")%></div>
            <div class="defaultText" style="width: 16px; display: inline-block; padding-left: 10px;">
                <asp:ImageButton ID="btnEditOption" runat="server" ImageUrl="/assets/images/application/icons/small/edit.gif"
                    ImageAlign="Bottom" /></div>
            <div class="defaultText" style="width: 16px; display: inline-block; padding-left: 10px;">
                <asp:ImageButton ID="btnDeleteCCCLogoOption" runat="server" ImageUrl="/assets/images/application/icons/small/delete.gif"
                    ImageAlign="Bottom" /></div>
            <div style="width: 970px; border-top: 1px dotted #ccc;">
            </div>
        </ItemTemplate>
    </asp:Repeater>
</div>


Can anyone shed some light on what's going on here?

Cheers
Rich

6 Answers, 1 is accepted

Sort by
0
RichJ
Top achievements
Rank 1
answered on 30 Mar 2012, 04:48 AM
Anyone?  Telerik?  Lots of money for support?
0
Maria Ilieva
Telerik team
answered on 30 Mar 2012, 03:05 PM
Hello Rich,

If I correctly understand your requirements you need to update the repeater OnWindowClose with ajax. If this is what you need to achieve I would suggest you to initiate ajaxRequest OnWindowClose and handle the server AjaxRequest to manipulate the Repeater. Please note that as I suppose your main RadAjaxManager is on the main page you should access it using its GetCurrent() method to initiate the ajaxRequest and also to add a programmatic setting in which the manager itself updates the repeater. For example:

function refreshBrandingOptions(ElementTypeID) {
            switch (ElementTypeID) {
                case 52:
                   $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("linkRefreshCCCLogos");
                    break;
                case 1:
                    ......                    
break;
                default:
                   ...
            }
        }

C#:
protected void Page_Load(object sender, EventArgs e)    
{        
    RadAjaxManager.GetCurrent(Page).AjaxSettings.AddAjaxSetting(RadAjaxManager.GetCurrent(Page), rCCCLogos);
   }

Give this a try and let me know if it helps.

All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
RichJ
Top achievements
Rank 1
answered on 31 Mar 2012, 09:35 PM
Thanks for the reply Maria.  It's rather annoying at the time taken to get a response - most here I would image have development projects that are time-based and a 2-3 day delay getting a response can be rather embarassing for us and ultimately reflect badly on Telerik.

I have applied the code you recommended, and while the page is not longer doing a full refresh, the actual control is not being updated.
Any other suggestions?

I thought this was the whole point of using a RadAjaxManagerProxy in user controls?

Rich
0
Maria Ilieva
Telerik team
answered on 04 Apr 2012, 01:52 PM
Hi Rich,

Note that the forum kind of tickets has response time to 72 hours. If you need guaranteed faster response please open a regular support ticket (which guarantee 24 hour response) and send us runnable version of your application. Thus we will be able to debug it locally and do our best to provide a proper solution in a timely manner.


Greetings,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
RichJ
Top achievements
Rank 1
answered on 04 Apr 2012, 08:46 PM
Fair enough Maria.

Still, no resolution to my issue.  No other thoughts from the development team?
I'm using this exact same process elsewhere, it just seems to be this one instance where it's not working.

I guess I should open a support ticket?

Rich
0
Maria Ilieva
Telerik team
answered on 09 Apr 2012, 09:49 AM
Hi Rich,

Opening a regular support ticket and sending us the problematic application will really be the best option for continue working on the problem,. In this case will be able to debug it locally and do our bets to provide a proper solution.

Regards,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
RichJ
Top achievements
Rank 1
Answers by
RichJ
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or