G
Guest
I have a label control that I've embedded in a datalist template. I will be
binding data to that label.
I want to run a string formatting function on the database text before it is
injected into the datalist. When I try to do this, I get a "... [control]
does not exist in the current context.
I need to know how to target the control. If I were writing Flash
actionscript, it would be something like
_root.myDatalist.myLabelInsideMyDatalist.Text =
processedTextThatIAlreadyRanThroughMyFunction
Is this possible? Am I running into a page lifecycle thing, or?
Thanks for any help. Actual code follows. I'm trying to inject the formatted
variable text into lblCon_Body.
-KF
<aspataList runat="server" id="DataList1" DataKeyField="Con_ContentID"
DataSourceID="SqlDataSource1" Width="100%" HorizontalAlign="Left"
CellPadding="0" >
<ItemTemplate>
<asp:Label Text='<%# Eval("Con_Title") %>' runat="server"
id="Con_TitleLabel" Font-Bold="True" Font-Size="Medium" />
<br />
<asp:Label Text='<%# Eval("Con_BylineCredit") %>' runat="server"
id="Con_BylineCreditLabel" Font-Italic="True" Font-Size="X-Small"
style="font-size: small; line-height: 15pt; font-style: italic; font-family:
Arial, Verdana, Sans-serif" />
<br />
<br />
<asp:Label Text='<%# Eval("Con_Body")%>' runat="server" ID="lblCon_Body"
Font-Italic="False" Font-Size="X-Small" style="font-size: small;
line-height: 15pt; font-style: italic; font-family: Arial, Verdana,
Sans-serif" /><br />
<br />
</ItemTemplate>
</aspataList>
binding data to that label.
I want to run a string formatting function on the database text before it is
injected into the datalist. When I try to do this, I get a "... [control]
does not exist in the current context.
I need to know how to target the control. If I were writing Flash
actionscript, it would be something like
_root.myDatalist.myLabelInsideMyDatalist.Text =
processedTextThatIAlreadyRanThroughMyFunction
Is this possible? Am I running into a page lifecycle thing, or?
Thanks for any help. Actual code follows. I'm trying to inject the formatted
variable text into lblCon_Body.
-KF
<aspataList runat="server" id="DataList1" DataKeyField="Con_ContentID"
DataSourceID="SqlDataSource1" Width="100%" HorizontalAlign="Left"
CellPadding="0" >
<ItemTemplate>
<asp:Label Text='<%# Eval("Con_Title") %>' runat="server"
id="Con_TitleLabel" Font-Bold="True" Font-Size="Medium" />
<br />
<asp:Label Text='<%# Eval("Con_BylineCredit") %>' runat="server"
id="Con_BylineCreditLabel" Font-Italic="True" Font-Size="X-Small"
style="font-size: small; line-height: 15pt; font-style: italic; font-family:
Arial, Verdana, Sans-serif" />
<br />
<br />
<asp:Label Text='<%# Eval("Con_Body")%>' runat="server" ID="lblCon_Body"
Font-Italic="False" Font-Size="X-Small" style="font-size: small;
line-height: 15pt; font-style: italic; font-family: Arial, Verdana,
Sans-serif" /><br />
<br />
</ItemTemplate>
</aspataList>