I want to close radwindow and refresh page. But when I run script, radwindow closed but redirect to hoem page.
<telerik:RadWindow ID="modalPopup" runat="server" ShowContentDuringLoad="true" VisibleStatusbar="false"
RegisterWithScriptManager="True" EnableShadow="True" ReloadOnShow="true" Width="760px"
Height="350px" Modal="True" OpenerElementID="btnAddContact" Skin="WebBlue">
<ContentTemplate>
<asp:UpdatePanel ID="Updatepanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnSave" runat="server" CssClass="acceptBTN btn h4" Text="ثبت" OnClick="btnSave_Click" />
<input type="button" value="انصراف" class="cancelBTN btn h4" onclick="CancelClick()" />
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
function CancelClick() {
var wnd = $find("<%=modalPopup.ClientID %>");
wnd.close();
window.parent.location.reload(true);
Sys.Application.remove_load(showDialogInitially);
window.top.location = this;
}
</script>
List.aspx.cs
string strStartUpScript = string.Format("javascript:CancelClick();"); ScriptManager.RegisterStartupScript(Page, GetType(), "PopupScript", strStartUpScript, true);