c# - Usercontrol .ascx variable access -



c# - Usercontrol .ascx variable access -

what should done solve problem of access?

markup:

<%@ command language="c#" autoeventwireup="true" codebehind="header.ascx.cs" inherits="version_2.themes.anatema.header" %> <%= deneme %>

code:

namespace version_2.themes.anatema { public partial class header : usercontrol { public string deneme = "asd"; } }

error:

the name 'deneme' not exist in current context

try this, should work.

<%@ command language="c#" autoeventwireup="true" codefile="user.ascx.cs" inherits="user" %> <asp:label id="label1" runat="server"> <%=test%> </asp:label>

code behind

using system; public partial class user : system.web.ui.usercontrol{ public string test = "this test"; protected void page_load(object sender, eventargs e){ this.databind(); } }

c# asp.net user-controls compiler-errors

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -