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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.