前台和后台数据分离

来源:互联网 发布:淘宝ppt 编辑:程序博客网 时间:2024/05/07 07:00

后台public partial class _Default : System.Web.UI.Page
{
    public string aaa;
    public string bbb;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            aaa = "dasa";
            bbb = "sdsa";
        }
    }
}

 

 

 

前台

<body>
    <form id="form1" runat="server">
    <div style="height: 22px">
        <table>
         <tr>
          <td>
           <span> <%=aaa %></span>
          </td>
         </tr>
        </table>
        <br />
       
        <br />
    </div>
    </form>
</body>