Howdy, y'all. I'm sure I'm missing something really basic, here. I'm trying to write some additional information to the client-side attributes for a raddateinput control. (This is part of a larger project, writing a custom validator, etc). I've simplified out to a basic web page illustrating my challenge. Here's my ASPX:
<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="test5.aspx.cs" Inherits="TASDashboard.Secured.test5" %> |
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> |
<%@ Register assembly="Controls" namespace="TASDashboard" tagprefix="cc1" %> |
<!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 id="Head1" runat="server"> |
<title>Untitled Page</title> |
</head> |
<body> |
<form runat="server"> |
<script language="javascript" type="text/javascript"> |
function testFunction(sender, args) { |
alert(sender.testAttribute); //shows as undefined |
} |
</script> |
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
</telerik:RadScriptManager> |
<telerik:RadDateInput ID="RadDateInput1" Runat="server" DateFormat="HHmm" |
Skin="Office2007"> |
</telerik:RadDateInput> |
<asp:ValidationSummary ID="ValidationSummary1" runat="server" /> |
<p> |
<asp:Button ID="Button1" runat="server" Text="Button" /> |
</p> |
</form> |
</body> |
</html> |
and here's my C#:
using System; |
using System.Collections.Generic; |
using System.Linq; |
using System.Web; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
namespace TASDashboard.Secured |
{ |
public partial class test5 : DashboardBasePage |
{ |
protected void Page_Load(object sender, EventArgs e) |
{ |
RadDateInput1.ClientEvents.OnValueChanged = "testFunction"; |
RadDateInput1.Attributes.Add("testAttribute", "hello"); |
} |
} |
} |
And when I run it, and change the value of the raddateinput control, my javascript routine runs as expected, but sender.testAttribute is undefined. Should I be looking somewhere else for testAttribute?
Thank you!
Scott