Open and Close Window without postback or flickering

3 posts, 0 answers
  1. Rafat Anwer
    Rafat Anwer avatar
    2 posts
    Member since:
    May 2010

    Posted 04 May 2010 Link to this post

    I have used telerik rad window in my page to display some messages and after taking some input from user with condition i fire an event on the parent page... Its working fine but problem is that its postbacking the whole page and page flicker for some seconds.
    I have also used Splitter and Slider Control in my Master Page
    All page Flicker for 2 -3 seconds when a page is opened first time.
    Please help me out.

    Rafat
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 04 May 2010 Link to this post

    Hello Rafat,

    A better suggestion to open the window without postback is by using client side API. The following documentation shows various functions that let you to open a RadWindow object from your client-side javascript:
    Opening Windows

    If you still want to open the radwindow from code behind, then you could ajaxify the control which initiates the postback to open the window. You can use either RadAjaxManager or RadAjaxPanel to ajaxify the control.

    Regards,
    Princy.
  3. Rafat Anwer
    Rafat Anwer avatar
    2 posts
    Member since:
    May 2010

    Posted 05 May 2010 Link to this post

    Dear Princy,

    Thanx for ur reply.
    when i added the button and window control in asp update panel its working fine and no flickering happens. but window re-opens when i close it.
    I have put a function on OnClintClose event on the parent page which binds the grid after closing the window..
    Below is the code : Please suggest me what to do.. Thanx in advance.
    aspx code:
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                   function OnClientClose(oWnd, args) {
                    $get('<%=btnCheck.ClientID%>').click();
                }
    </script>
    </telerik:RadCodeBlock>
    <asp:UpdatePanel ID="aa14" runat="server">
     <ContentTemplate>                                                                            
     <telerik:RadWindowManager ID="RadWinMan2" runat="server">
          <Windows>
               <telerik:RadWindow ID="RadWinRafat" runat="server">
     </telerik:RadWindow>
             </Windows>
    </telerik:RadWindowManager>                                                                                
    <asp:Button ID="btnCheck" runat="server" Text="Check" SkinID="Button" Style="visibility: hidden;" OnClick="btnCheck_Click" />
        <asp:Button ID="btnAddtogrid" runat="server" OnClick="btnAddtogrid_Click"    CssClass="buttonBlue" ValidationGroup="add" CausesValidation="false" Text="Add to Prescription"  Width="125px" OnClientClick="return DrugValidation('ctl00_ContentPlaceHolder1_ddlunit_DropDown','ctl00_ContentPlaceHolder1_txtQtyAmount','ctl00_ContentPlaceHolder1_txt_Days');" />
            </ContentTemplate>
            </asp:UpdatePanel>

    Code behind :
    RadWinRafat.NavigateUrl = "~/EMR/Medication/MedicationCheckMsg.aspx?DrugId=" + strDrugId;
                    
                        RadWinRafat.Height = 530;
                        RadWinRafat.Width = 468;
                        RadWinRafat.Top = 40;
                        RadWinRafat.Left = 100;
                        RadWinRafat.Modal = true;
                        RadWinRafat.Behaviors = WindowBehaviors.Maximize | WindowBehaviors.Close | WindowBehaviors.Move | WindowBehaviors.Pin;
                    
                        RadWinRafat.OnClientClose = "OnClientClose";
                    
                        RadWinRafat.VisibleOnPageLoad = true; // Set this property to True for showing window from code
                     
                        RadWinRafat.DestroyOnClose = true;
                        RadWinMan2.DestroyOnClose = true;

    protected void btnCheck_Click(object sender, EventArgs e)
        {
            if (Convert.ToString(Session["Override"]) == "1")
            {
                AddToGrid();
                btnAddtogrid.Text = "Add to Prescription";
                btnAddToDailyMedication.Text = "Add to Daily Medications";
                lstdrug.SelectedIndex = -1;
            }
        }


     
Back to Top