Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
my masterpage have some server control like this:
<form id="form1" runat="server"> <umbraco:Macro Alias="aaa" runat="server"></umbraco:Macro> <asp:HiddenField runat="server" ID="hidtest" Value="why i can not findcontrol" /> </form>
string val= ((HiddenField)this.Page.Master.FindControl("hidtest")).Value;
but run will get a NullReferenceException,why i can not get a value from masterpage?
thanks in advance
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
UserControl FindControl from masterpage get a NullReferenceException
my masterpage have some server control like this:
Macro aaa call .NET User Control,in usercontrol the code like this:
string val= ((HiddenField)this.Page.Master.FindControl("hidtest")).Value;
but run will get a NullReferenceException,why i can not get a value from masterpage?
thanks in advance
is working on a reply...