Hi Telerik team,
I am facing one problem with use of RadAjaxPanel. I have following code:
This code throws error "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
If I wrap RadAjaxPanel in another div(server control) then code works as expected.
So I have a working solution for such problem, But can anyone provide more insight into this?
Regards
Shrikant
I am facing one problem with use of RadAjaxPanel. I have following code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxPanel.aspx.cs" Inherits="WebApplication10.AjaxPanel" %> |
<!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"> |
<div> |
<img src="<%= MyServer + "images/uparrow.gif"%>" /> |
<telerik:RadScriptManager ID="mgr1" runat="server"></telerik:RadScriptManager> |
<telerik:RadAjaxPanel ID="panel1" runat="server"></telerik:RadAjaxPanel> |
</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 WebApplication10 |
{ |
public partial class AjaxPanel : System.Web.UI.Page |
{ |
public string MyServer { get { return "http://server/"; } } |
protected void Page_Load(object sender, EventArgs e) |
{ |
} |
} |
} |
This code throws error "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)."
If I wrap RadAjaxPanel in another div(server control) then code works as expected.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AjaxPanel.aspx.cs" Inherits="WebApplication10.AjaxPanel" %> |
<!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"> |
<div> |
<img src="<%= MyServer + "images/uparrow.gif"%>" /> |
<telerik:RadScriptManager ID="mgr1" runat="server"></telerik:RadScriptManager> |
<div id="wrapper" runat="server"> |
<telerik:RadAjaxPanel ID="panel1" runat="server"></telerik:RadAjaxPanel> |
</div> |
</div> |
</form> |
</body> |
</html> |
So I have a working solution for such problem, But can anyone provide more insight into this?
Regards
Shrikant