When I try putting it in the html and not the code behind, it works fine. Only problem is like I said above is that when the user clicks on the image, it needs to copied. The JS OnClientClick event obvioulsy fires before the OnClick server side event (which does the file copying). Therefore, it has to be done in the code behind. If somebody can help me figure out what I'm doing wrong, I would greatly appreciate it.
Here is my abbreviated HTML. Note that the RadScriptManager resides on a MasterPage:
<code>
<
telerik:RadWindowManager ID="RadWindowManager1" runat="server">
</telerik:RadWindowManager>
<%-- <Windows>
<telerik:RadWindow ID="RadWindow1" runat="server" ShowContentDuringLoad="false" Width="1000px"
Height="600px" Title="View Chart" Behaviors="Default" Skin="Outlook" Modal=true>
</telerik:RadWindow>
</Windows>--%>
<%--<script type="text/javascript">
//<![CDATA[
function openRadWin() {
radopen("../scan/viewChart.aspx", "RadWindow1");
}
//]]>
</script>--%>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGridBulkCharts">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridBulkCharts" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="chkBulk">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="chkBulk" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadGridEDLogFiles">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGridEDLogFiles" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="chkEDLog">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="chkEDLog" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<code>
Notice I have the client code commented out which I said works fine just to see if it gets into the page_load event of the child page. It does from the client side (when the code is uncommented), but from the server side, the Load event is not hit.
Here is my abbreviated server side code in the event once the onclick event happens:
<code>
protected void Chart_Click(object sender, ImageClickEventArgs e)
{
file = new FileInfo(ChartPath + imgName);
string cpPath = (string)settingsReader.GetValue("tmpImageFolder", typeof(String)) + ViewState["UserName"].ToString();
if (file.Exists)
{
if (!Directory.Exists(cpPath))
{
Directory.CreateDirectory(cpPath);
}
file.CopyTo(cpPath + file.Name, true);
RadWindowManager1.Windows.Clear();
RadWindow newwindow = new RadWindow();
newwindow.ID = "RadWindow1";
newwindow.ShowContentDuringLoad = false;
newwindow.Width = Unit.Pixel(1000);
newwindow.Height = Unit.Pixel(600);
newwindow.Title = "View Chart Image";
newwindow.Behaviors = WindowBehaviors.Default;
newwindow.Skin = "Outlook";
newwindow.Modal = true;
newwindow.VisibleOnPageLoad = true;
newwindow.NavigateUrl = "../scan/viewChart.aspx";
newwindow.Visible = true;
RadWindowManager1.Windows.Add(newwindow);
}
}
</code>
I checked the RadWindowManager1.Windows.Count property and shows it to be 1.
What am I doing wrong that the page doesn't come up???