J
Jeff
Hey
ASP.NET 2.0
Below you see the code I'm having problem with. In the Open_Message
event/method I want to get the value of the HiddenField at the row in the
repeater control I clicked.... my goal is to get the id (not a control Id,
but an id related to a database record) of a row in the repeater control. I
don't want to use Get... I've tryed to use e.FindControl in the Open_message
event but FindControl isn't available, so I don't know how to get the
value....
<asp:Repeater ID="rptMessages" runat="server" DataSourceID="odsMessage"
OnItemDataBound="Display_Messages">
<HeaderTemplate><table width="100%"></HeaderTemplate>
<ItemTemplate>
<asp:HiddenField ID="fhId" runat="server" />
<tr>
<td >
<div style="width:100%; height:100%; background-color:Lime;">
<div style="width:75px; height:75px; float:right;">
<asp:ImageButton ID="MemberPhoto" runat="server" Width="75px"
Height="75px" />
</div>
<asp:Label ID="lblHeader" runat="server" Text=""></asp:Label>
<asp:LinkButton ID="lbkLinkToMessage" runat="server"
OnCommand="Open_Message">Reply</asp:LinkButton>
<asp:Literal ID="ltMessage" runat="server"></asp:Literal>
</div>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
protected void Open_Message(object sender, EventArgs e)
{
HiddenField hiddenField = (HiddenField) e..Item.FindControl("fhId");
********* here is my problem
//FindControl isn't available here, this code don't compile.........
}
Any suggestions?`
Jeff
ASP.NET 2.0
Below you see the code I'm having problem with. In the Open_Message
event/method I want to get the value of the HiddenField at the row in the
repeater control I clicked.... my goal is to get the id (not a control Id,
but an id related to a database record) of a row in the repeater control. I
don't want to use Get... I've tryed to use e.FindControl in the Open_message
event but FindControl isn't available, so I don't know how to get the
value....
<asp:Repeater ID="rptMessages" runat="server" DataSourceID="odsMessage"
OnItemDataBound="Display_Messages">
<HeaderTemplate><table width="100%"></HeaderTemplate>
<ItemTemplate>
<asp:HiddenField ID="fhId" runat="server" />
<tr>
<td >
<div style="width:100%; height:100%; background-color:Lime;">
<div style="width:75px; height:75px; float:right;">
<asp:ImageButton ID="MemberPhoto" runat="server" Width="75px"
Height="75px" />
</div>
<asp:Label ID="lblHeader" runat="server" Text=""></asp:Label>
<asp:LinkButton ID="lbkLinkToMessage" runat="server"
OnCommand="Open_Message">Reply</asp:LinkButton>
<asp:Literal ID="ltMessage" runat="server"></asp:Literal>
</div>
</td>
</tr>
</ItemTemplate>
<FooterTemplate></table></FooterTemplate>
protected void Open_Message(object sender, EventArgs e)
{
HiddenField hiddenField = (HiddenField) e..Item.FindControl("fhId");
********* here is my problem
//FindControl isn't available here, this code don't compile.........
}
Any suggestions?`
Jeff