I've got a simple Rad Window popup box that contains a couple of text boxes and a combo box (5 records) and the page load time is around 5 seconds which is far too long.
I'm using the RadScriptManager, StyleSheetManager and AjaxManager, along with setting web config debug=false but still none of this has made a difference. I've even removed all the controls but the load time is still extremelly slow...
Code below, hopefully you can tell me where I'm going wrong...
Cheers
Cliff
Master Page for popup:
<%
@ Master Language="C#"
AutoEventWireup="true"
CodeFile="MasterPageDialogs.master.cs"
Inherits="MasterPageDialogs"
%>
<%
@ Register Assembly="Telerik.Web.UI"
Namespace="Telerik.Web.UI"
TagPrefix="telerik"
%>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</
head>
<
body>
<form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Windows7"></telerik:RadSkinManager>
<telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server"></telerik:RadStyleSheetManager>
<telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Windows7" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
<div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<!-- Popup Dialog/Windows, e.g. MessageBox -->
<telerik:RadWindowManager ID="RadWindowManager" runat="server"
Behavior="Default" InitialBehavior="None" EnableViewState="False">
<Windows>
<telerik:RadWindow runat="server" ID="RadWindowMessageBox" Behavior="Default" InitialBehavior="None"
NavigateUrl="~/Dialogs/MessageBox.aspx" ReloadOnShow="true" Animation="None"
Height="150px" Modal="true" Title="MessageBox" Width="350px" AnimationDuration="750" Behaviors="Close" Enabled="True" VisibleStatusbar="False" IconUrl="~/favicon.ico">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
</form>
</
body>
</
html>
POPUP aspx:
<%
@ Page Title=""
Language="C#"
MasterPageFile="~/MasterPageDialogs.master"
AutoEventWireup="true"
CodeFile="CreateTask.aspx.cs"
Inherits="Dialogs_CreateTask"
%>
<%
@ MasterType VirtualPath="~/MasterPageDialogs.master" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"></asp:Content>
<
asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<
telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server"></telerik:RadAjaxManagerProxy>
<script type="text/javascript">
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)
return oWindow;
}
function CloseOnReload() {
GetRadWindow().close();
}
function RefreshParentPage() {
GetRadWindow().BrowserWindow.location.href = GetRadWindow().BrowserWindow.location.href;
}
</script>
<table cellpadding="1" cellspacing="1" border="0" width="100%">
<tr>
<td>
<asp:Label ID="lblTitle" runat="server" Text="Title:"></asp:Label>
</td>
<td>
<telerik:RadTextBox ID="txtTitle" runat="server" Width="290px"></telerik:RadTextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label>
</td>
<td>
<telerik:RadTextBox ID="txtDescription" runat="server" Width="290px" ></telerik:RadTextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblEvent" runat="server" Text="Event:"></asp:Label>
</td>
<td>
<telerik:RadComboBox ID="cboEvents" Runat="server" Width="290px"></telerik:RadComboBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDueDate" runat="server" Text="Due Date:"></asp:Label>
</td>
<td>
<telerik:RadDatePicker runat="server" ID="RadDatePickerDueDate"></telerik:RadDatePicker>
</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr align="center">
<td colspan="2">
<asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click"></asp:Button>
</td>
</tr>
</table>
</
asp:Content>
 
POPUP Code:
using
System;
using
Telerik.Web.UI;
public
partial class Dialogs_CreateTask : System.Web.UI.Page
{
#region
Events
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
LoadEvents();
}
}
catch (Exception ex)
{
Master.ShowMsgBoxPopup(
"Error Loading Page", Napp_ErrorTrapping.BuildExeceptionMessage(ex));
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
string result = ControlsAreValid();
if (result == "Success")
{
string username = Page.User.Identity.Name;
string taskID = EM_Data.CreateTask(txtTitle.Text,
txtDescription.Text,
username,
RadDatePickerDueDate.SelectedDate.ToString(),
int.Parse(cboEvents.SelectedValue));
Session.Add(
"ACTION", "TASK ADDED");
Session.Add(
"TASK_ID", taskID);
RadScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "RefreshParentPage();", true);
RadScriptManager.RegisterStartupScript(this, this.GetType(), "closeWindow", "CloseOnReload();", true);
}
else
{
Master.ShowMsgBoxPopup(
"Cannot Save Task", result);
}
}
catch (Exception ex)
{
Master.ShowMsgBoxPopup(
"Cannot Save Task", Napp_ErrorTrapping.BuildExeceptionMessage(ex));
}
}
#endregion
#region
Methods
private string ControlsAreValid()
{
string result = "Success";
if (txtTitle.Text == "")
result =
"Please enter a 'Title' for this task.";
if (RadDatePickerDueDate.SelectedDate == null)
result =
"Please enter a 'Due Date' for this task.";
if (cboEvents.SelectedValue == "0")
result =
"Please select an 'Event' for this task.";
 
return result;
}
private void LoadEvents()
{
cboEvents.DataValueField =
"EventID";
cboEvents.DataTextField =
"EventTitle";
cboEvents.DataSource =
EM_Data.SearchEvents(Page.User.Identity.Name, true);
cboEvents.DataBind();
}
#endregion
}