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
Post a Comment