Hi,
We have an in-house CMS. Various functionality happens in modules. Any number and configuration (including duplicates) of modules can be added to a page. Users with appropriate permissions can open a RadWindow that contains a page where they can update the settings for that module.
Currently, when they close the window the whole page reloads with their updated settings. This works but we would like to make it better.
However, we would like to modify this behavior. Each module is wrapped in an update panel. When the RadWindow closes only the appropriate update panel is updated. Even then, if possible it should only update if they click the "update" button in the window and not if they click the "cancel" button or the "X" on the RadWindow.
I have found one solution. However, it seems "hackish".
Is there an easier way to do this?
Thanks,
Jeff Paetkau
PS: If you attempt to attach a zip file, you get the error "File is not of correct type." However, there does not appear to be any way to remove the file. It seems the only way to continue posting is to attach an image.
We have an in-house CMS. Various functionality happens in modules. Any number and configuration (including duplicates) of modules can be added to a page. Users with appropriate permissions can open a RadWindow that contains a page where they can update the settings for that module.
Currently, when they close the window the whole page reloads with their updated settings. This works but we would like to make it better.
However, we would like to modify this behavior. Each module is wrapped in an update panel. When the RadWindow closes only the appropriate update panel is updated. Even then, if possible it should only update if they click the "update" button in the window and not if they click the "cancel" button or the "X" on the RadWindow.
I have found one solution. However, it seems "hackish".
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Random_String_Control.ascx.cs" Inherits="AJAX_Test.Random_String_Control" %> |
<asp:UpdatePanel UpdateMode="Conditional" runat="server"> |
<ContentTemplate> |
<script type="text/javascript"> |
function clientClose_<%= Refresh_Random_String.ClientID %>(sender, args) { |
document.getElementById('<%= Refresh_Random_String.ClientID %>').click(); |
} |
</script> |
<asp:Literal runat="server" ID="Random_String" /> |
<asp:Button ID="Refresh_Random_String" runat="server" OnClick="Refresh_Random_String_Click" Text="Refresh Random String" /> |
<rad:RadWindow ID="Window" runat="server" Modal="true" NavigateUrl="http://google.ca" /> |
<asp:Button ID="Open_Window" runat="server" Text="Open Window" OnClick="Open_Window_Click" /> |
</ContentTemplate> |
</asp:UpdatePanel> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
namespace AJAX_Test |
{ |
public partial class Random_String_Control : System.Web.UI.UserControl |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
if(!IsPostBack) |
Random_String.Text = Guid.NewGuid().ToString(); |
Window.VisibleOnPageLoad = false; |
Window.OnClientClose = "clientClose_" + Refresh_Random_String.ClientID; |
} |
protected void Open_Window_Click(object sender, EventArgs e) |
{ |
Window.VisibleOnPageLoad = true; |
} |
protected void Refresh_Random_String_Click(object sender, EventArgs e) |
{ |
Random_String.Text = Guid.NewGuid().ToString(); |
} |
} |
} |
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="AJAX_Test._Default" %> |
<!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"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager runat="server" /> |
<div> |
1 : |
<asp:PlaceHolder ID="One" runat="server" /> |
</div> |
<br /> |
<div> |
2 : |
<asp:PlaceHolder ID="Two" runat="server" /> |
</div> |
<br /> |
<div> |
3 : |
<asp:PlaceHolder ID="Three" runat="server" /> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
namespace AJAX_Test |
{ |
public partial class _Default : System.Web.UI.Page |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
One.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); |
Two.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); |
Three.Controls.Add(Page.LoadControl("Random_String_Control.ascx")); |
} |
} |
} |
Is there an easier way to do this?
Thanks,
Jeff Paetkau
PS: If you attempt to attach a zip file, you get the error "File is not of correct type." However, there does not appear to be any way to remove the file. It seems the only way to continue posting is to attach an image.