how to call a variable in code behind to aspx page

后端 未结 9 1927
暗喜
暗喜 2020-11-27 07:06

i know i have seen this but cant recall the correct way of doing it... basically i have a string variable called \"string clients\" in my .cs file.. but i wasn\'t to be able

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 07:23

    First you have to make sure the access level of the variable is protected or public. If the variable or property is private the page won't have access to it.

    Code Behind

    protected String Clients { get; set; }
    

    Aspx

    <%=Clients %> 
    

提交回复
热议问题