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

Open and Close Window without postback or flickering

2 Answers 293 Views
Window
This is a migrated thread and some comments may be shown as answers.
Rafat Anwer
Top achievements
Rank 1
Rafat Anwer asked on 04 May 2010, 11:37 AM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 May 2010, 12:16 PM
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.
0
Rafat Anwer
Top achievements
Rank 1
answered on 05 May 2010, 06:34 AM
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;
        }
    }


 
Tags
Window
Asked by
Rafat Anwer
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Rafat Anwer
Top achievements
Rank 1
Share this question
or