Hi all,
I've got a problem with the findcontrol function. I use this function in a usercontrol to retrieve a value from an hidden field in the page (Dim iTypeOfNews As Integer = Convert.ToInt16(CType(Page.FindControl("fldNews"), HiddenField).Value)). It all worked fine, untill I put that page in a contenplaceholder in a masterpage. The function can't find the hiddenfield anymore.
The code:
<%@ Page Language="VB" MasterPageFile="~/Main.master" Trace="true" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %>
<%@ Register Src="UserControls/News.ascx" TagName="News" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">
<asp:HiddenField ID="fldNews" runat="server" Value="1" />
<uc1:News ID="News1" runat="server" />
</asp:Content> Has someone a solution?
Thanks in advance.
Regards,
Erik