c# - Unable to access User Control's child controls from code behind -


i trying access of user controls' child controls code behind. of them working while others not. faulty user controls don't have designer files. want know if reason? if can't create of controls scratch complex , designer sent them without designer file , can't give him code correct went outside town.

moreover looking great without designer file in design view. when write this:

button1.visible=false;

it's showing button1 not exist in current context. please tell me how solve this?

following markup of 1 of faulty user-control:

<%@ control language="c#" autoeventwireup="true" codefile="commentui.ascx.cs" inherits="commentui" %> <asp:button id="button1" runat="server" text="button" /> 

code-behind file:

using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols;  public partial class commentui : system.web.ui.usercontrol {     protected void page_load(object sender, eventargs e)     {         button1.visible = false;     } } 

try creating ascx scratch shows designer well.


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -