Rahul Singh
How you can access fields & properties defined in code behind in ASPX page?
By Rahul Singh in ASP.NET on Dec 24 2014
  • Venkataramana murthy
    Sep, 2016 14

    Thanks

    • 1
  • Rahul Singh
    Dec, 2014 24

    Suppose we have field `Id` & property `Name` defined in code behind calss we can access them in ASPX page like this:- Id: <%= Id% > Name: <%= Name %>

    • 1
  • Pankaj  Kumar Choudhary
    May, 2015 14

    if we have Salary field in Aspx.cs Int Salary=1000; then we can use Salary in aspx page like as Sal:<%=Salary%>

    • 0
  • keyur
    Feb, 2015 10

    define your property as public or protected in code behind file.using server side syntax you can use that in aspx filepublic string CodeBehindVarProperty{get{return "Property Variable";} }protected void Page_Load(object sender, EventArgs e){// Bind data from code-behind to ASPX server controlsPage.DataBind();}in aspx<%=CodeBehindVarPublic %>

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS