J
Jason Wright via .NET 247
Hiya,
I've created a UserControl with some Custom properties and assigned databinding expressions to the properties in the aspx. Does anyone know why these expressions are not being evaluated?
eg.
<uc1:ControlX id="la" runat="server" ClientClick='javascriptfunction(<%# DataBinder.Eval(Container.DataItem, "Id")%>)' />
after processing renders in html as
<table id="la" [other attributes] onclick="javascriptfunction(<%# DataBinder.Eval(Container.DataItem, "Id"
%>)">
instead of
<table id="la" [other attributes] onclick="javascriptfunction(1)">
ControlX is implemented as follows:
public class ControlX : UserControl
{
private HtmlTable tableControl;
[other stuff]
public string ClientClick
{
set
{
tableControl.Attributes["onclick"] = value;
}
}
[other stuff]
}
I've created a UserControl with some Custom properties and assigned databinding expressions to the properties in the aspx. Does anyone know why these expressions are not being evaluated?
eg.
<uc1:ControlX id="la" runat="server" ClientClick='javascriptfunction(<%# DataBinder.Eval(Container.DataItem, "Id")%>)' />
after processing renders in html as
<table id="la" [other attributes] onclick="javascriptfunction(<%# DataBinder.Eval(Container.DataItem, "Id"

instead of
<table id="la" [other attributes] onclick="javascriptfunction(1)">
ControlX is implemented as follows:
public class ControlX : UserControl
{
private HtmlTable tableControl;
[other stuff]
public string ClientClick
{
set
{
tableControl.Attributes["onclick"] = value;
}
}
[other stuff]
}