I’ve had this strange problem come up. I have a RowDataBound event handler for a repeater control.
I have the code:
HiddenField hfIpAddressRangeId = (HiddenField)e.Row.FindControl("hfIpAddressRangeId");
hfIpAddressRangeId.Value = .IpAddressRangeId.ToString();
But when I look at the html the value of that control is not set. However when I set the value using inline C# such as
<asp:HiddenField runat="server" Value='<%# Eval("IpAddressRangeId ") %>' ID="hfIpAddressRangeId" ViewStateMode="Enabled" />
The value is being set. I’m not really sure why this won’t work when I bind each datarow?
It looks like
IpAddressRangeIdis a part of your datasource, hence the use ofEvalin the second example. Have you tried this?: