Need help getting the value in a HiddenField!
- From: "Jeff" <it_consultant1@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 15:57:51 +0200
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
.
- Follow-Ups:
- Re: Need help getting the value in a HiddenField!
- From: bruce barker \(sqlwork.com\)
- Re: Need help getting the value in a HiddenField!
- From: Mark Fitzpatrick
- Re: Need help getting the value in a HiddenField!
- Prev by Date: Re: ASP.Net to SMS Text for UK
- Next by Date: Re: Session Variables - why aren't novice developers warned?
- Previous by thread: Using line breaks in text
- Next by thread: Re: Need help getting the value in a HiddenField!
- Index(es):