1. I have a page with a button and a asp panel control.
2. The page has been Ajaxified using the RADPrometheus Ajax Manager.
3. Click of button triggers dynamic load of a user control into the panel
4. The user control includes webusercontrol.js file via Script Manager Proxy.
5. User control has a button and a text box
6. Button click has been wired to call a setTest() js function defined in webusercontrol.js
7. When the page renders, I click the button to dynamically load the user control into the panel.
8. Clicking the button on the user control to set the text results in "Object required" error. What is happening is that the setText() function defined in the included script file is not visible.
//// Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikAjaxTest._Default" EnableEventValidation="false" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ 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">
<title>Telerik Prometheus RADAjaxManager Text</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"
EnablePartialRendering="true"
EnablePageMethods="true"
LoadScriptsBeforeUI="true">
<Scripts></Scripts>
</asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnLoadControl">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="pnlContent" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div>
<asp:Button ID="btnLoadControl" runat="server" Text="Load Control" />
</div>
<div>
<asp:Panel ID="pnlContent" runat="server"></asp:Panel>
</div>
</form>
</body>
</html>
////// Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace TelerikAjaxTest {
public partial class _Default:System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) {
this.btnLoadControl.Click += new EventHandler(btnLoadControl_Click);
}
void btnLoadControl_Click(object sender, EventArgs e) {
this.pnlContent.Controls.Clear();
UserControl uc;
uc = Page.LoadControl("WebUserControl1.ascx") as UserControl;
if (uc != null) {
this.pnlContent.Controls.Add(uc);
}
}
}
}
//// WebUserControl1.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="TelerikAjaxTest.WebUserControl1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Scripts>
<asp:ScriptReference Path="WebUserControl.js" NotifyScriptLoaded="true" />
</Scripts>
</asp:ScriptManagerProxy>
<div>
Web User Control with Script Manager Proxy
This controls is loaded dynamically via the click of the button on
the main page
</div>
<div>
<button id="btnAddText" runat="server" onclick="setText">Set Text</button>
</div>
<div>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</div>
<script type="text/javascript">
var txtNameId=<%= txtName.ClientID %>;
alert('WebUserControl1.ascx');
</script>
////// WebUserControl.js
// WebUserControl.js
function setText(){
var oTxt=$get(txtNameId);
if((oTxt!=null)&&(typeof(oTxt)!='undefined')){
oTxt.value=oTxt.value+'Some Text';
}
}
// Notify the AJAX framework that this script has completed loading.
// Making this the last line in the file ensures that this is executed
// last
if(typeof(Sys) !== "undefined")Sys.Application.notifyScriptLoaded();
Any feed back appreciated
thanks
zaphod
65 Answers, 1 is accepted

Unfortunately this is a problem with our current implementation. I will forward your request to our development team.
One possible workaround is to set the Visible property of the UserControl to false. Please find attached a sample web application that demonstrates the needed approach.
Let me know if you have other question and/or problems.
Kind regards,
Plamen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

For example, an application may have a RadTree in a splitter pane on the left, and a Panel in the pane on the right. Depending on which tree node is clicked, a different user control will be dynamically loaded on the right. If there are 50 nodes on the left it would be highly impractical to load all 50 user controls (with Visible-false) on the right...just so that the resources will be available if its associated node is clicked.
I would consider this current shortcoming to be a very, very serious one. After all, how can you have an EnablePageHeadUpdate property at all if it doesn't work when set to true?
This is a showstopper for us. Without this functionality, we will be forced to stick w/ the non-Prometheus version of RadAjaxManager. This really concerns me, given the fact that it will eventually be unsupported. I'm also not sure of the implications of moving to the other Prometheus controls, but having to stay with a prior version of RadAjaxManager.
Thanks,
Ross
The second workaround is using RadScriptBlock to add an external javascript. I prepared another sample project (AJAXEnabledWebSite16.zip) for your reference and attached the files to this thread.
I hope the current solution is applicable for you.
Sincerely yours,
Plamen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center


I am using RadCodeBlock with <% %> elements so I can not put it into a script file like your example ....
The fact that the script is not getting loaded for subsequent loads of different usercontrols looks very much like an URGENT bug.
The problem has already been addressed. I am attaching a trial version of the fix here for testing. Whoever needs dev build, please open a support ticket and we will provide you with one.
Sorry for the inconvenience.
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Can you please elaborate on which "problem" had been already fixed? The original RADAjax manager does not load JS files in dynamically loaded user control
or
Michael Tissington's specific issue with using RADCode block
If the original issue has been addressed I would like to get the hot fix too
Please advise
thanks
ramesh


But if you staticaly load controls in Page_Load method all works perfect(but only for blocks stored in MS AjaxPanels)
Michael: I believe that I have pointed you to the problem in your case in your support ticket
Ramesh: the original issue has not yet been fixed. It is logged in our bug tracking system and we will address it for subsequent release of the control (we will do our best to fix it for the official Prometheus release).
Best wishes,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center


The issue is still not resolved, bur our developers are aware of it and will address it soon.
I hope it is not causing you much inconvenience in the meantime.
All the best,
Yavor
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center



<telerik:RadCodeBlock ID="block1" runat="server"> |
<script language="javascript"> |
var Grid_CCC; |
var Master_CCC; |
function GridCreated_CCC(sender, eventArgs) |
{ |
Grid_CCC = sender; |
Master_CCC = Grid_CCC.get_masterTableView(); |
} |
</telerik:RadCodeBlock> |
I have a grid later in the control which has a clientsetting
OnGridCreated
="GridCreated_CCC"
When the user control is dynamically loaded after an ajax update, I get a javascript error telling me that GridCreated_CCC does not exist. I believe this is an example of the issue discussed in this thread. As you can see, I use a RadCodeBlock. I have also tried to use a RadScriptBlock, but the same error occurs. Is there any update as to a fix or workaround to this issue. It seems like it has been around a very long time.
I am using the 2008 Q3 version 1314 controls.
Have you tried to register the OnGridCreated client handler using the ScriptManager.RegisterStartupScript static method from within the dynamically loaded web user control? Thus the script should be registered and accessible on the page when you load the user control on ajax request.
Another approach you can try is to move the RadCodeBlock on the main page.
Kind regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

As for A), how do I use RegisterStartUpScript to register an event handler like Grid_Created? And where within the usercontrol event cycle? Can you please provide an example.
Generally RadCodeBlock cannot execute JavaScript - you should use RadScriptBlock instead.
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

The signature of the method is specified in the MSDN article linked in my previous reply. You can use it in the same manner as you will register other javascript function in this case.
Regards,
Sebastian
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

ScriptManager.RegisterStartupScript(Me, Me.GetType, "CCC", "GridCreated_CCC", True) |
But it didn't seem to make a difference. I still get a 'GridCreated_CCC' is undefined javascript error when the usercontrol is loaded with an ajax update. I also tried it with the same syntax, but "False" for the include script tags attribute, and there was no difference.

I assume that this error is expected as you haven't really registered the 'GridCreated_CCC' method. Try the following:
Dim script As String = "var Grid_CCC; var Master_CCC; " + "function GridCreated_CCC(sender, eventArgs) { " |
+ " Grid_CCC = sender; Master_CCC = Grid_CCC.get_masterTableView(); } " |
ScriptManager.RegisterStartupScript(Page, GetType(Page), "script", script, True) |
Tell me if it works.
Thanks,
SamJ


I agree with you.
However until it is fixed, what we could do is to find alternative solutions for our cases. What I do if I were in your situation, I would move my client script into js files and just register the file through the ScriptManager.
Regards,
SamJ

<style type="text/css"> |
#<%= Me.GetMyAjaxManagerUpdatePanelId("pnlGrid") %> |
{ |
margin:0; |
height:100%; |
} |
</style> |
GetMyAjaxManagerUpdatePanelId is a method which returns the client Id of the update panel.
This style block cannot be placed in an external; .js file.

I hope you find resolution for your issues soon.
SamJ

I have attached a small application demonstrating similar scenario. Can you please take a look maybe I'm missing something obvious?
Greetings,
Rosen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.


Can you please send us (attached to a formal ticket) a small sample project in which the behavior in question can be reproduce? Thus we will be able to gather more details about the your exact scenario and provide you with detailed answer.
Sincerely yours,
Rosen
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.

If you have any javascript script blocks within the user control....
You must either, set the ajaxmanager RestoreOriginalRenderDelegate property to true, or your page must inherit from the Telerik RadJaxPage base class instead of System.Web.UI.Page.
Doing the first will in all likelihood prevent your app from working in many 3rd party hosting environments as they are being run in medium trust.
Doing the second is certainly straightforward, however, in many cases a developer does not have a choice of which page base class to inherit from, as is the case in my scenario.
So for me, it would appear that the use of Telerik Ajax to load User controls has some serious limitations. According to the support tech, these are limitations of MS Ajax, and there is no way around them except the two methods I mentioned.

Is the above the last word on this problem? I am trying to create a RadGrid using a user control as the insert/edit form. I've found that on adding a new row to the grid the user control's javascript is not recognized. That is, I get a " 'Null' is not null or an object" error message on the OnClientClick event.
I don't have any problem with editing strangely enough. If information exists then the form works without error.
I've also tried to put the usercontrol's Javascript and include it in a RadScriptBlock, but I receive an error that the .js file cannot be found.
Any news on this? Solutions?
Sincerely,
Josh
Can you send us small example (via support ticket) where we can reproduce and debug this problem?
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

I have solved my problem. Because the radgrid dynamically loads the usercontrol the clientIDs do not yet exist. Therefore, it is necessary to pass the clientIDs from the RadGrid1_ItemDataBound event after the usercontrol has been loaded to the Javascript via something like the below code:
script.Append("clientCalendar = '" + calendarClientID + "';"); |
RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(script.ToString()); |
The clientCalendar is a variable in the Javascript that gets populated with the ClientID value from the C# code.
My biggest issue was the fact that the Item could be obtained from Insert, but not edit, in the ItemCommand Event.
Like so:
if (e.CommandName == RadGrid.InitInsertCommandName) |
{ |
other code... |
GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem(); |
// Get the insert/edit form's user control |
UserControl uc = insertedItem.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl; |
} |
If you attempt to do something like the above except with the RadGrid.EditCommandName it fails. The ItemDataBound event must be used to obtain the user control during the Edit event.
Josh

Setting the RadAjaxManager RestoreOriginalRenderDelegate to True on the container page did not resolve this issue. Client side function still not found on the .ascx and prevented LoadControl from succeeding.
Are you doing something different to allow this to work?


Albert, thanks for the prompt response.
This seemed like a promising resolution, since I've got control of the environment, but to no avail. Telerik to this point, has been unable to provide a workable solution despite repeated inquiries.
Thanks again for your response.
Can you please provide more detailed information on what your scenario is? Please verify that your are using RadScriptBlock control around the scripts you need to be loaded. It will be appreciated if you can send us (attached to a formal ticket) a small runnable sample.
Also did you look at the attached sample in this thread which demonstrates similar functionality.
Best wishes,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Your site has literally dozens of non working samples (pick any one), including this thread, yet no working solution from Telerik. Your group has never given any working solution to this issue. Please provide a solution to the original issue listed on this thread. This has not happened to date.
As evidenced in this thread, even experienced Telerik users have given up on this technique, due to the inability to determine a workable solution. This appears to be an issue known to your group for at least two years.
I have attached a fully runnable sample which demonstrates how to accomplish the scenario from the first post in this thread. Please let me know if I'm missing something obvious.
All the best,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

As you can see the UpdatePanel is commented out and it is just a leftover from some testing not related to the sample. As to the rest of the code and naming etc. it is directly taken from the first post in this thread.
Note that the example is not how to load/reload usercontrols but to demonstrate the script resolving.
Sincerely yours,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

So, that is why I abandoned the idea of dynamically loading user controls using AJAX. Just so I'm clear, regardles of whether the previously attached project solves the original issue in this thread, Telerik hasn't yet come up with a better way (other that the two options I mentioned) of circumventing this limitaiton in AJAX. Is this correct?
If I can recall correctly you have issues with medium trust environments and as you know (and stated in the docs) in order RadAjax to work as expected in such environments RadAjaxPage need to be used due to some limitations in ASP.NET Page's architecture in extensibility aspect. In full trust environments (as the one demonstrated in the sample) there is not need for such extra step and scripts should be evaluated in the demonstrated manner.
However with Q1 2010 version of RadControls for ASP.NET AJAX we will introduce an interface which can be implemented in case you are using a base page which cannot be modified. By using this interface you will be able to use the RadAjax in medium trust environments by providing the RadAjaxPage's functionality by your own, thus without need to directly inherit from RadAjaxPage.
Kind regards,
Rosen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.


Has this problem been fixed in the latest version? If it is, please let us know the version details.
Thanks,
Deepak Saboji.

Normally, when you have javascript block in your dynamically loaded control, for that javascript to be evaluated properly, you need to wrap it in a RadScriptBlock.
A possible reason for this solution not to work is if you have any invalid ajax settings. So you should either refactor your ajax settings or register the scripts manually calling the ScriptManager.RegisterStartupScript() static method.
All the best,
Iana
the Telerik team

Rosen posted:
"However with Q1 2010 version of RadControls for ASP.NET AJAX we will introduce an interface which can be implemented in case you are using a base page which cannot be modified. By using this interface you will be able to use the RadAjax in medium trust environments by providing the RadAjaxPage's functionality by your own, thus without need to directly inherit from RadAjaxPage."
Thanks,
The mentioned interface was implemented just as my colelague stated. You can find more information on it here.
Regards,
Iana
the Telerik team


I also can't fix this issue.
Master page i referenced some javascript files, css and inline script. And added the RadCodeBlock, RadAjaxManager and RadAjaxLoadingPanel. After post back reference javascript, css and inline script are not working.
<
head
>
<
script
type
=
"text/javascript"
src
=
"../../Scripts/jquery-1.6.1.min.js"
></
script
>
<
script
type
=
"text/javascript"
src
=
"../../Scripts/jquery_YPbanner.js"
></
script
>
<
script
type
=
"text/javascript"
>
//TEXT RESIZE
function getCookie(c_name) {
if (document.cookie.length > 0) {
c_start = document.cookie.indexOf(c_name + "=");
if (c_start != -1) {
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1) c_end = document.cookie.length;
return unescape(document.cookie.substring(c_start, c_end));
}
}
return "";
}
function setCookie(c_name, value, expiredays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie = c_name + "=" + escape(value) +
((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
}
var sitefunctions = {
textresize: function() {
// show text resizing links
var $cookie_name = "PAGCFontSize";
var originalFontSize = $("body").css("font-size");
// if exists load saved value, otherwise store it
if (getCookie($cookie_name)) {
var $getSize = getCookie($cookie_name);
$("body").css({ fontSize: $getSize + ($getSize.indexOf("px") != -1 ? "" : "px") }); // IE fix for double "pxpx" error
if ($getSize.indexOf(14) != -1) { $(".gc_resizeBig").addClass("gc_resizeActive"); }
if ($getSize.indexOf(12) != -1) { $(".gc_resizeNormal").addClass("gc_resizeActive"); }
if ($getSize.indexOf(10) != -1) { $(".gc_resizeSmall").addClass("gc_resizeActive"); }
} else {
setCookie($cookie_name, originalFontSize);
}
// reset
$(".gc_resizeNormal").bind("click", function() {
$("body").css("font-size", 12);
setCookie($cookie_name, 12);
$(".gc_resizeActive").removeClass("gc_resizeActive");
$(this).addClass("gc_resizeActive");
return false;
});
// text small
$(".gc_resizeSmall").click(function() {
$("body").css("font-size", 10);
setCookie($cookie_name, 10);
$(".gc_resizeActive").removeClass("gc_resizeActive");
$(this).addClass("gc_resizeActive");
return false;
});
$(".gc_resizeBig").click(function() {
$("body").css("font-size", 14);
setCookie($cookie_name, 14);
$(".gc_resizeActive").removeClass("gc_resizeActive");
$(this).addClass("gc_resizeActive");
return false;
});
}
};
$(document).ready(function() {
$(".gc_homeTabsContents > div").hide();
$(".gc_homeTabsContents > div:first").show();
$(".gc_homeTabsItems ul li").click(function() {
if ($(this).attr("class") != "active") {
//SWITCH TAB STYLE
$(this).siblings().removeClass("active");
$(this).addClass("active");
//SWITCH CONTENT
var thisnum = $("a", this).attr("href");
$(".gc_homeTabsContents > div").hide();
$(".gc_homeTabsContents").find(thisnum).show();
}
})
//BANNER
$('.BannerHolder').BannerRotator({
delay: 5000,
speed: 1000,
controlPOS: 'BR',
arrow: false,
startNum: 0
});
//============ TEXT RESIZE
sitefunctions.textresize();
});
</
script
>
<!-- <link href="../_Survey/NSurveyAdmin/CSS/nsurveyadmin.css" type="text/css" rel="stylesheet" /> -->
<
link
href
=
"../App_Themes/infolab/basic.css"
type
=
"text/css"
rel
=
"stylesheet"
/>
<
link
href
=
"../App_Themes/infolab/CustomTelerik.css"
type
=
"text/css"
rel
=
"stylesheet"
/>
</
head
>
<
body
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function RequestStart(sender, args) {
// the following Javascript code takes care of expanding the RadAjaxLoadingPanel
// to the full height of the page, if it is more than the browser window viewport
var loadingPanel = $get("<%= RadAjaxLoadingPanel1.ClientID %>");
var pageHeight = document.documentElement.scrollHeight;
var viewportHeight = document.documentElement.clientHeight;
if (pageHeight > viewportHeight) {
loadingPanel.style.height = pageHeight + "px";
}
var pageWidth = document.documentElement.scrollWidth;
var viewportWidth = document.documentElement.clientWidth;
if (pageWidth > viewportWidth) {
loadingPanel.style.width = pageWidth + "px";
}
// the following Javascript code takes care of centering the RadAjaxLoadingPanel
// background image, taking into consideration the scroll offset of the page content
if ($telerik.isSafari) {
var scrollTopOffset = document.body.scrollTop;
var scrollLeftOffset = document.body.scrollLeft;
}
else {
var scrollTopOffset = document.documentElement.scrollTop;
var scrollLeftOffset = document.documentElement.scrollLeft;
}
var loadingImageWidth = 55;
var loadingImageHeight = 55;
loadingPanel.style.backgroundPosition = (parseInt(scrollLeftOffset) + parseInt(viewportWidth / 2) - parseInt(loadingImageWidth / 2)) + "px " + (parseInt(scrollTopOffset) + parseInt(viewportHeight / 2) - parseInt(loadingImageHeight / 2)) + "px";
}
</
script
>
</
telerik:RadCodeBlock
>
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
ClientEvents
OnRequestStart
=
"RequestStart"
/>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"pnl_Loading"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"pnl_Loading"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
IsSticky
=
"true"
CssClass
=
"ModalPanel"
Transparency
=
"50"
/>
<
asp:Panel
ID
=
"pnl_Loading"
runat
=
"server"
>
</
asp:Panel
>
</
body
>
Try setting the EnablePageHeadUpdate property of the RadAjaxManager to false and see if it works.
You can also replace the RadCodeBlock with RadScriptBlock and let me know if it makes any difference. Or at leaset wrap the scripts in the <head> tag with RadScriptBlock.
All the best,
Iana Tsolova
the Telerik team

After I changed EnablePageHeadUpdate property of the RadAjaxManager to false, the javascript is working fine.
One more question, now i can't open RadAjaxManager1.ResponseScripts.Add(@"radalert('Class has been updated.', 300, 110,'Class Management');"); in my user control.
Is there any way to call this kind of function.
Thanks.
Try registering the scripts through the ScriptManage instead:
ScriptManager.RegisterStartupScripts(Page, typeof(Page), "script", radalert('Class has been updated.', 300, 110,'Class Management');", true);
Greetings,
Iana Tsolova
the Telerik team

I still have a problem , i put RadAjaxManager, Loading Panel and RadAjaxPanel in master page.
Normal functions look fine.
But for RadUpload control not working. If generated excel file, got issue like that "Server cannot set content type after HTTP headers have been sent.".
So many problems.
Thanks.,

Hi all,
I have following scenario.
I am using the radgrid with Edit Usercontrol.
In user control we do some operation and show the status of operation via RADWindow …
My problem is – when I am showing the message using the RADWINDOW my page gets postback and I lost my current page position so I need to again scroll the page.
I also try for RadAjaxPanel – it gives me exception like
Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.
And Exception details are
DotNetNuke.Services.Exceptions.PageLoadException: Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error. ---> System.Web.HttpException: Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error. ---> System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). at System.Web.UI.ControlCollection.AddAt(Int32 index, Control child) at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) --- End of inner exception stack trace --- at Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) at Telerik.Web.UI.RadAjaxControl.PerformRender() at Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) at Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at DotNetNuke.Framework.PageBase.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Please suggest is any alternative way to do this ……
Thank you once again to all
Using RadAjaxPanel should automatically keep the scroll position as you need. As for the error you are facing I would suggest you to review the help topic below which elaborates on its fixing:
http://www.telerik.com/help/aspnet-ajax/ajax-radscriptblock-radcodeblock.html
All the best,
Maria Ilieva
the Telerik team


Here is my script and I even put the scripts in the RadScriptBlock / RadCodeBlock :
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="CDEDistricts.aspx.vb" Inherits="CDEDistricts" title="Custom Drivers by Distrcit" EnableEventValidation="false" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<style type="text/css">
.style1
{
width: 292px;
}
p.MsoNormal
{margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";
margin-left: 0in;
margin-right: 0in;
margin-top: 0in;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">
<%--<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>--%>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
<Scripts>
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
</Scripts>
</telerik:RadScriptManager>
<asp:Panel ID="pnlRegion" runat="server">
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="gvCustomDriver">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="gvCustomDriver" UpdatePanelCss
LoadingPanelID="RadAjaxLoadingPanel2" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
<script type="text/javascript">
function EnableEditing(a) {
for (var i = 0; i < document.forms[0].elements.length; i++) {
var element = document.forms[0].elements[i];
switch (element.type) {
case 'text':
if (a) {
document.forms[0].elements[i].readOnly = false;
}
else {
document.forms[0].elements[i].readOnly = true;
document.forms[0].elements[i].style.background = '#eeeeee';
}
break;
}
}
}
function hourglass() {
document.body.style.cursor = "wait";
}
function preventBackspace(e) {
var evt = e || window.event;
if (evt) {
var keyCode = evt.charCode || evt.keyCode;
if (keyCode === 8) {
if (evt.preventDefault) {
evt.preventDefault();
} else {
//Check if the text box is read only and then disable the backspace functionality
if (document.getElementById("ctl00_MainContentPlaceHolder_gvCustomDriver_ctl02_lblSunHrs").getAttribute("readonly")) {
evt.returnValue = false;
}
}
}
}
}
</script>
</telerik:RadScriptBlock>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" Height="75px"
Width="75px" Transparency="0">
<%--<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border: 0;" />
--%>
<img alt="Loading..." src= "Images/pleasewait.gif" style="border: 0;"/>
</telerik:RadAjaxLoadingPanel>
<h2 class="GridHeading">Custom Driver Entry
Form: <table>
<%-- jsy - todo - Do Not show the Regions drop down to these groups. --%>
<%' If Not Session.Item("IsWFMCATDistrictAdmin") = True Then%>
<tr>
<td align="left" colspan="3">
<p>
<span>Please select the desired division, region and district to enter custom
driver information for all locations in that district. You can edit and save
the week that is 4 weeks out or more as of Friday 10:00pm. If there are no
values for a driver then the previous week's values are displayed. Please make
sure you select the Save and Export button to save the data.</span><p>
</p>
<p>
</p>
<h2 class="RowLabel">
</h2>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
<p>
</p>
</p>
</td>
</tr>
<tr>
<td colspan="3">
</td>
<td>
<asp:CheckBox ID="btnAllWeels" runat="server" Checked="True"
Text="copy to all weeks"
Font-Italic="True" Font-Size="X-Small" />
</td>
</tr>
<tr>
<td class="RowLabel" style="width:100px;">
Division:</td>
<td width="10px">
</td>
<td align="left" class="style1">
<asp:DropDownList ID="ddlDivision" runat="server" AutoPostBack="true"
Height="31px" Width="293px">
<asp:ListItem Selected="True" Value="71">Macys</asp:ListItem>
<asp:ListItem Value="72">Bloomingdales</asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:ImageButton ID="btnSave" runat="server" ImageAlign="Middle"
ImageUrl="Images/Save_and_Export.jpg" />
</td>
</tr>
<tr>
<td class="RowLabel" style="width:100px;">
Region:</td>
<td width="10px">
</td>
<td align="left" class="style1">
<asp:DropDownList ID="ddlRegions" runat="server" AutoPostBack="true"
Height="31px" Width="293px">
</asp:DropDownList>
<cc1:CascadingDropDown ID="ddlRegions_CascadingDropDown" runat="server"
Category="orglev3" Enabled="True" PromptText="Please select a Region"
ServiceMethod="GetRegions" ServicePath="MacysOrgLevels.asmx"
TargetControlID="ddlRegions" UseContextKey="True">
</cc1:CascadingDropDown>
</td>
<td>
<asp:ImageButton ID="btnScreenPrintDist1" runat="server" ImageAlign="Middle"
ImageUrl="~/Images/screen_print.jpg" onclientclick="window.print()"
Enabled="False" ToolTip="save records before you print" />
</td>
</tr>
<tr>
<td class="RowLabel" style="width:100px;">
District:</td>
<td width="10px">
</td>
<td align="left" class="style1">
<asp:DropDownList ID="ddlDistricts" runat="server" AutoPostBack="true"
Height="31px" Width="293px">
</asp:DropDownList>
<cc1:CascadingDropDown ID="ddlDistricts_CascadingDropDown" runat="server"
Category="orglev4" Enabled="True"
LoadingText="Please wait while the list is being loaded."
ParentControlID="ddlRegions" PromptText="Please select a District"
ServiceMethod="GetDistricts" ServicePath="MacysOrgLevels.asmx"
TargetControlID="ddlDistricts" UseContextKey="True">
</cc1:CascadingDropDown>
</td>
</tr>
<tr ID="trAMC" runat="server" visible="false">
<td class="RowLabel" style="width:100px;">
AMC Week:</td>
<td width="10px">
</td>
<td class="RowLabel">
<asp:DropDownList ID="ddlAMCWeek" runat="server" AutoPostBack="true"
EnableViewState="true" Height="31px" Width="50px">
</asp:DropDownList>
Week Begin Date: <asp:Label ID="lblAMCWeek" runat="server"></asp:Label>
<asp:LinkButton ID="lnkExcel" runat="server" CssClass="RowLabel" Text="Export"
ToolTip="Export the Custom driver data to Excel" visible="false"></asp:LinkButton>
<asp:CheckBox ID="chkHideZeroes" runat="server" visible= "true" AutoPostBack="True" Text="HideZeroes"
ToolTip="Check or uncheck this box to hide or show the custom driver values which are all zeroes for the whole week." Checked="True" />
Page Size:
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
EnableViewState="true" Height="31px" Width="50px">
<asp:ListItem>10</asp:ListItem>
<asp:ListItem>20</asp:ListItem>
<asp:ListItem Selected="True">50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
<asp:ListItem>1000</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td align="left" colspan="3">
<asp:Label ID="lblMessage" runat="server" CssClass="RowLabel" ForeColor="Red"
Visible="false"></asp:Label>
</td>
</tr>
<tr>
<td align="left" colspan="3">
<asp:Label ID="lblMessageWeek" runat="server" CssClass="RowLabel"
ForeColor="#cc0000" Visible="false"></asp:Label>
</td>
</tr>
<tr>
<td colspan="3">
<asp:ValidationSummary ID="ValidationSummary1" runat="server"
DisplayMode="BulletList" EnableClientScript="true"
HeaderText="You must enter correct value in the following fields:"
ShowMessageBox="true" />
</td>
</tr>
</table>
</h2>
<asp:GridView ID="gvCustomDriver" runat="server" AutoGenerateColumns="False"
DataKeyNames="DEPARTMENT,CUSTOMDRIVER,SUNHRS,MONHRS,TUESHRS,WEDHRS,THURSHRS,FRIHRS,SATHRS,DeptTotal,PrimKey"
HeaderStyle-HorizontalAlign="Center" HeaderStyle-VerticalAlign="Middle"
RowStyle-VerticalAlign="Bottom" ShowFooter="True" PageSize="50"
AllowPaging="True" AllowSorting = "true" >
<RowStyle VerticalAlign="Bottom" />
<Columns>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="Store"
SortExpression="STORE">
<EditItemTemplate>
<asp:Label ID="txtStore" runat="server" Text='<%# Bind("STORE") %>'></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtNewStoreNum" runat="server" MaxLength="4"
Text='<%# Bind("STORE") %>' visible="false"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblStoreNum" runat="server" Text='<%# Bind("STORE") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="Dept."
SortExpression="DEPARTMENT">
<EditItemTemplate>
<asp:Label ID="txtDeptNum" runat="server" Text='<%# Bind("DEPARTMENT") %>'></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtNewDeptNum" runat="server" MaxLength="4"
Text='<%# Bind("DEPARTMENT") %>' visible="false"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblDeptNum" runat="server" Text='<%# Bind("DEPARTMENT") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="Driver Name"
SortExpression="CUSTOMDRIVER">
<EditItemTemplate>
<asp:Label ID="txtDriverName" runat="server" Text='<%# Bind("CUSTOMDRIVER") %>'></asp:Label>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="txtNewDriverName" runat="server"
Text='<%# Bind("CUSTOMDRIVER") %>' visible="false"></asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:Label ID="lblCustomDriver" runat="server"
Text='<%# Bind("CUSTOMDRIVER") %>'></asp:Label>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="Middle"
HeaderText="SUN" SortExpression="SUNHRS">
<EditItemTemplate>
<asp:TextBox ID="txtSunHrs" runat="server" MaxLength="2"
Text='<%# Bind("SUNHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlSunHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblSunHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("SUNHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator1" runat="server"
ControlToValidate="lblSunHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Sunday hours must be between 0 to 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator1" runat="server"
ControlToValidate="lblSunHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Sunday hours must be between 0 to 9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Left" VerticalAlign="Middle" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="MON" SortExpression="MONHRS">
<EditItemTemplate>
<asp:TextBox ID="txtMonHrs" runat="server" MaxLength="2"
Text='<%# Bind("MONHRS") %>'></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlMonHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblMonHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("MONHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator2" runat="server"
ControlToValidate="lblMonHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Monday hours must be between 0 to 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator22" runat="server"
ControlToValidate="lblMonHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Monday hours must be between 0 to 9999.99"
ValueToCompare="9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="TUE" SortExpression="TUESHRS">
<EditItemTemplate>
<asp:TextBox ID="txtTuesHrs" runat="server" MaxLength="2"
Text='<%# Bind("TUESHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlTuesHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblTuesHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("TUESHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator3" runat="server"
ControlToValidate="lblTuesHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Tuesday hours must be between 0 and 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator2a" runat="server"
ControlToValidate="lblTuesHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Tuesday hours must be between 0 and 9999.99"
ValueToCompare="9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="WED" SortExpression="WEDHRS">
<EditItemTemplate>
<asp:TextBox ID="txtWedHrs" runat="server" MaxLength="2"
Text='<%# Bind("WEDHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlWedHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblWedHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("WEDHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator4" runat="server"
ControlToValidate="lblWedHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Wednesday hours must be between 0 and 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator2b" runat="server"
ControlToValidate="lblWedHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Wednesday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="THU" SortExpression="THURSHRS">
<EditItemTemplate>
<asp:TextBox ID="txtThursHrs" runat="server" MaxLength="7"
Text='<%# Bind("THURSHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlThursHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblThursHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("THURSHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator5" runat="server"
ControlToValidate="lblThursHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Thursday hours must be between 0 and 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator2c" runat="server"
ControlToValidate="lblThursHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Thursday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="FRI" SortExpression="FRIHRS">
<EditItemTemplate>
<asp:TextBox ID="txtFriHrs" runat="server" MaxLength="2"
Text='<%# Bind("FRIHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlFriHrs" runat="server" visible="false">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblFriHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("FRIHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator6" runat="server"
ControlToValidate="lblFriHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Friday hours must be between 0 and 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator2d" runat="server"
ControlToValidate="lblFriHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Friday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header"
HeaderStyle-HorizontalAlign="center" HeaderText="SAT" SortExpression="SATHRS">
<EditItemTemplate>
<asp:TextBox ID="txtSatHrs" runat="server" MaxLength="2"
Text='<%# Bind("SATHRS") %>' Width="19"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlSatHrs" runat="server" visible="false"
Font-Bold="True" Font-Italic="True" ForeColor="Red">
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblSatHrs" runat="server" Columns="3" MaxLength="7"
onKeyDown="preventBackspace();" Text='<%# Bind("SATHRS") %>'></asp:TextBox>
<asp:RangeValidator ID="CompareValidator7" runat="server"
ControlToValidate="lblSatHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Saturday hours must be between 0 and 9999.99"
MaximumValue="9999.99" MinimumValue="0" Type="Double" ValueToCompare="9999.99">*</asp:RangeValidator>
<asp:RequiredFieldValidator ID="RangeValidator2e" runat="server"
ControlToValidate="lblSatHrs" Display="Dynamic" EnableClientScript="true"
ErrorMessage="The Saturday hours must be between 0 and 9999.99">*</asp:RequiredFieldValidator>
</ItemTemplate>
<HeaderStyle CssClass="header" HorizontalAlign="Center" />
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="header" HeaderText="Edit"
Visible="false">
<EditItemTemplate>
<asp:ImageButton ID="btnUpdate" runat="server" AlternateText="Update"
CausesValidation="True" CommandName="Update" ImageUrl="Images/accept.png"
ToolTip="Update" />
<asp:ImageButton ID="btnCancel" runat="server" AlternateText="Cancel"
CausesValidation="False" CommandName="Cancel" ImageUrl="Images/cancel.png"
ToolTip="Cancel" />
</EditItemTemplate>
<FooterTemplate>
<asp:LinkButton ID="lnkAdd" runat="server" CommandName="AddNew" Visible="false">Add New</asp:LinkButton>
</FooterTemplate>
<ItemTemplate>
<asp:ImageButton ID="btnEdit" runat="server" AlternateText="Edit"
CausesValidation="False" CommandName="Edit" ImageUrl="Images/pencil.png"
ToolTip="Edit" />
</ItemTemplate>
<HeaderStyle CssClass="header" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Total Hours" SortExpression="DeptTotal">
<EditItemTemplate>
<asp:TextBox ID="txtDeptTotal" runat="server" MaxLength="2"
Text='<%# Bind("DeptTotal") %>' Width="19px" Font-Bold="True"
Font-Italic="True" ForeColor="#EC0000" Enabled="False"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlDeptTotal" runat="server" BackColor="White"
Font-Bold="True" Font-Italic="True" ForeColor="#D90000" Enabled="False" >
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblDeptTotal" runat="server" Columns="3" ForeColor="Red"
MaxLength="7" onKeyDown="preventBackspace();" ReadOnly="True"
Text='<%# Bind("DeptTotal") %>' Enabled="False"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Primary Key" SortExpression="PrimKey" Visible="false">
<EditItemTemplate>
<asp:TextBox ID="PrimKey" runat="server" MaxLength="2"
Text='<%# Bind("PrimKey") %>' Width="19px" Font-Bold="True"
Font-Italic="True" ForeColor="#EC0000" Enabled="False"></asp:TextBox>
</EditItemTemplate>
<FooterTemplate>
<asp:TextBox ID="ddlPrimKey" runat="server" BackColor="White"
Font-Bold="True" Font-Italic="True" ForeColor="#D90000" Enabled="False" >
</asp:TextBox>
</FooterTemplate>
<ItemTemplate>
<asp:TextBox ID="lblPrimKey" runat="server" Columns="3" ForeColor="Red"
MaxLength="7" onKeyDown="preventBackspace();" ReadOnly="True"
Text='<%# Bind("PrimKey") %>' Enabled="False"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:GridView>
<%--add both save and print buttons at the end of the page--%>
<asp:ImageButton ID="btnSave0" runat="server" ImageAlign="Bottom"
ImageUrl="Images/Save_and_Export.jpg" Visible="False" />
<asp:ImageButton ID="btnScreenPrintDist2" runat="server" ImageAlign="Bottom"
ImageUrl="~/Images/screen_print.jpg" onclientclick="window.print()"
Visible="False" />
<br />
<asp:Panel ID="pnlButtons" runat="server" Visible="false">
<table>
<tr id="trButtons" runat="server">
<td>
<asp:ImageButton ImageUrl="Images/Back.jpg" ID="btnBack" Text="Back" runat ="server"/>
</td>
</tr>
</table>
</asp:Panel>
</asp:Panel>
<asp:Panel ID="NoAccessPanel" runat="server" Visible="false">
<table>
<tr>
<td align="center"> <h1 style="color:Red"> No Access </h1> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<asp:Label ID="lblNoAccess" runat="server" Font-Size="Large"></asp:Label>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center">
<asp:ImageButton ID="btnReturnToHome" runat="server"
ImageUrl="~/Images/Home_Return.jpg"
PostBackUrl="~/Introduction.aspx" />
</td>
</tr>
</table>
</asp:Panel>
</asp:Content>

any solution for this problem ??
I have the some problem with a user control
I use Page.LoadControl('my control') but not load the javascript functions.
As this thread become rather big and different issues are discussed in it, I would suggest you to open separate support tickets and send us detailed description of the exact issues you are facing.
Thus we will be able to handle them with the required attention needed for your specific cases.
Regards,
Maria Ilieva
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.