Full postback when refreshing from RadWindow OnClientClose

7 posts, 0 answers
  1. RichJ
    RichJ avatar
    83 posts
    Member since:
    Aug 2006

    Posted 27 Mar 2012 Link to this post

    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

  2. RichJ
    RichJ avatar
    83 posts
    Member since:
    Aug 2006

    Posted 29 Mar 2012 Link to this post

    Anyone?  Telerik?  Lots of money for support?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 30 Mar 2012 Link to this post

    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.
  5. RichJ
    RichJ avatar
    83 posts
    Member since:
    Aug 2006

    Posted 31 Mar 2012 Link to this post

    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
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 04 Apr 2012 Link to this post

    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.
  7. RichJ
    RichJ avatar
    83 posts
    Member since:
    Aug 2006

    Posted 04 Apr 2012 Link to this post

    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
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 09 Apr 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017