前台<%=(ViewState["demo"])==null?string.Empty:ViewState["demo"].ToString())%>后台声明一个ViewState,并在page_load中初始化protected void Pageload(){ if(!IsPostBack) { ViewState["demo"]=string.Empty;}}