H
Harry
Hi,
Can anyone tell me why the below code does not work.
I dont get any errors, but nor does the Text for the asp:label get
set.
Thanks in advance as always
H
protected void Page_Load(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
if (Request.QueryString["Range"] == "Plat_Price"){
string PlatLabel = "Platino";
Label hypSelectC = (Label)e.Item.FindControl("hypSelectC");
hypSelectC.Text = "PlatLabel";
}
}
And in the html I have the following label, which is contained within
a Datalist.
<ASP
ataList ID="dlListCases"
RepeatColumns="2"
RepeatDirection="Horizontal"
RepeatLayout="Table" ItemStyle-CssClass="CaseRightBorder"
runat="server">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0"
class="CaseTable">
<tr>
<td colspan="2" class="CaseTableHeader"><%#
DataBinder.Eval(Container.DataItem, "CaseName") %>
</td>
</tr>
<tr>
<td width="75" valign="middle">
<asp:image runat="server" AlternateText="Thumbnail" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "image_thumb") %>'/>
<br>
</td>
<td width="134" valign="top"> <%#
DataBinder.Eval(Container.DataItem,
"Bullet_Points").ToString().Replace("\n","<br>") %>
<br>
<b>Price:
<%# DataBinder.Eval(Container.DataItem, "PriceCol", "{0:c}") %>
<asp:label CssClass="BoldLabel" ID="hypSelectC"
runat="server"></asp:label>
</b>
</td>
</tr>
</table>
</ItemTemplate>
</ASP
ataList>
Can anyone tell me why the below code does not work.
I dont get any errors, but nor does the Text for the asp:label get
set.
Thanks in advance as always
H
protected void Page_Load(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)
{
if (Request.QueryString["Range"] == "Plat_Price"){
string PlatLabel = "Platino";
Label hypSelectC = (Label)e.Item.FindControl("hypSelectC");
hypSelectC.Text = "PlatLabel";
}
}
And in the html I have the following label, which is contained within
a Datalist.
<ASP
RepeatColumns="2"
RepeatDirection="Horizontal"
RepeatLayout="Table" ItemStyle-CssClass="CaseRightBorder"
runat="server">
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0"
class="CaseTable">
<tr>
<td colspan="2" class="CaseTableHeader"><%#
DataBinder.Eval(Container.DataItem, "CaseName") %>
</td>
</tr>
<tr>
<td width="75" valign="middle">
<asp:image runat="server" AlternateText="Thumbnail" ImageUrl='<%#
DataBinder.Eval(Container.DataItem, "image_thumb") %>'/>
<br>
</td>
<td width="134" valign="top"> <%#
DataBinder.Eval(Container.DataItem,
"Bullet_Points").ToString().Replace("\n","<br>") %>
<br>
<b>Price:
<%# DataBinder.Eval(Container.DataItem, "PriceCol", "{0:c}") %>
<asp:label CssClass="BoldLabel" ID="hypSelectC"
runat="server"></asp:label>
</b>
</td>
</tr>
</table>
</ItemTemplate>
</ASP