This is a migrated thread and some comments may be shown as answers.

JS not working within User Control

2 Answers 44 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kit
Top achievements
Rank 1
Kit asked on 22 Nov 2010, 01:02 PM
Hi all

I'm creating a user control which builds on the RadDatePicker, essentially giving the developer the opportunity to pair date pickers together to form a min/max combination.  But on adding the user control to an aspx page, none of the inherent RadDatePicker client side stuff seems to work!

User control. 
<%@ Control Language="C#" AutoEventWireup="true" ClassName="kitsTest" CodeBehind="itsMinMaxRadDatePicker.ascx.cs" Inherits="UserControls.itsMinMaxRadDatePicker" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<telerik:RadDatePicker ID="itsRadDatePicker" DateInput-OnClientDateChanged="itsMinMaxRadDatePicker" runat="server" />
with nothing in the code behind yet.

I add this custom control to my aspx page like so:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/FormMasterPage2.master" AutoEventWireup="true" CodeBehind="AcademicYearEdit.aspx.cs" Inherits="Infrastructure.AcademicYearEdit" %>
<%@ Register TagPrefix="itsRadDatePicker" TagName="kitsTest" Src="UserControls/itsMinMaxRadDatePicker.ascx" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="Content3" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<itsRadDatePicker:kitsTest ID="test1" runat="server"></itsRadDatePicker:kitsTest>
</asp:Content>

It appears on the page, but when I click on the calendar image, nothing happens!  Its as if none of the JS is working...

Any hints for me?

Thanks in advance

kitster

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 23 Nov 2010, 07:44 AM
Hello Kit,

I have tried the same in my application and that worked for me.Please make sure that you have enabled the java script in your browser.

Please go through the following link for more information.
http://www.alanwood.net/demos/enabling-javascript.html.

Thanks,
Princy.
0
Kit
Top achievements
Rank 1
answered on 23 Nov 2010, 10:46 AM
Princy,

Thanks, but that wasn't it.  Turns out it was a simple js error in some custom code that was failing and therefore bringing down the whole lot...

Sorted now, thanks anyway.

kitster
Tags
Calendar
Asked by
Kit
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Kit
Top achievements
Rank 1
Share this question
or