I am running asp.net 3.5 and I am trying to add a Telerik Date Picker. I am registering the Telerik.Web.UI. I only have this section of code on the page that is using Telerik (it is being used twice as I'm also wanting to add an end date).
I have tried wrapping it in a RadControlBlock to no avail. Any help is appreciated.
| <telerik:RadDatePicker ID="RDPBeginDate" runat="server"> |
| <Calendar> |
| <SpecialDays> |
| <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" /> |
| </SpecialDays> |
| </Calendar> |
| </telerik:RadDatePicker> |
I have tried wrapping it in a RadControlBlock to no avail. Any help is appreciated.
5 Answers, 1 is accepted
0
Hello Tommy ,
Try wrapping your client-code into a RadCodeBlock or RadScriptBlock control and see if it makes any difference.
Additionally, check out this help article:
http://www.telerik.com/help/aspnet/tabstrip/tab_move_codeblocks.html
Greetings,
Pavlina
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.
Try wrapping your client-code into a RadCodeBlock or RadScriptBlock control and see if it makes any difference.
Additionally, check out this help article:
http://www.telerik.com/help/aspnet/tabstrip/tab_move_codeblocks.html
Greetings,
Pavlina
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.
0
Tommy T
Top achievements
Rank 1
answered on 06 Jan 2010, 06:06 PM
I apologize, I meant to say CodeBlock instead of ControlBlock.
I tried them since I kept seeing the same response to no avail:
and
Produced the same error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
As for the article you mentioned, this isn't a script and I am not trying to reference a variable within running script. I am simply attempting to add a Date Picker to an area of a webpage.
I tried them since I kept seeing the same response to no avail:
| <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> |
| <telerik:RadDatePicker ID="RDPBeginDate" runat="server"> |
| <Calendar> |
| <SpecialDays> |
| <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" /> |
| </SpecialDays> |
| </Calendar> |
| </telerik:RadDatePicker> |
| </telerik:RadScriptBlock> |
and
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <telerik:RadDatePicker ID="RDPBeginDate" runat="server"> |
| <Calendar> |
| <SpecialDays> |
| <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" /> |
| </SpecialDays> |
| </Calendar> |
| </telerik:RadDatePicker> |
| </telerik:RadCodeBlock> |
Produced the same error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
As for the article you mentioned, this isn't a script and I am not trying to reference a variable within running script. I am simply attempting to add a Date Picker to an area of a webpage.
0
Schlurk
Top achievements
Rank 2
answered on 06 Jan 2010, 08:51 PM
The RadCodeBlock has to be wrapped around your client-side code, aka Javascript. Where you are currently wrapping it is not where the RadCodeBlocks should go since this is the declaration of the control, not the block of javascript causing an error. If you have any javascript with the <%...%> tags in them in the <head> tag then you need to either move it out of there, or wrap it in a RadCodeBlock.
0
Tommy T
Top achievements
Rank 1
answered on 06 Jan 2010, 09:00 PM
I'm not sure if you're seeing what I'm seeing. There is absolutely no javascript being used. All I am trying to do is get the RadDatePicker to display. Nothing more nothing less.
0
Hello Tommy T,
Are you saying that you don't have server-side code blocks ( <%= ....... %> ) anywhere on the page? Can you send us a runnable demo, which reproduces the problem? Here is a simple test page, based on your RadDatePicker declaration, which works as expected.
Regards,
Dimo
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.
Are you saying that you don't have server-side code blocks ( <%= ....... %> ) anywhere on the page? Can you send us a runnable demo, which reproduces the problem? Here is a simple test page, based on your RadDatePicker declaration, which works as expected.
<%@ Page Language="C#" %><%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"><meta http-equiv="content-type" content="text/html;charset=utf-8" /><title>RadControls</title></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" /><telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="50" BackColor="Yellow" /><telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RDPBeginDate"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RDPBeginDate" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><telerik:RadDatePicker ID="RDPBeginDate" runat="server" AutoPostBack="true"> <Calendar> <SpecialDays> <telerik:RadCalendarDay Repeatable="Today" ItemStyle-CssClass="rcToday" /> </SpecialDays> </Calendar> </telerik:RadDatePicker> </form></body></html>Regards,
Dimo
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.
