用了my97date插件 查询一个时间段得内容时候 查询结束后刷新了页面 但是里面的值清空了
如何保存用户输入的查询日期?

解决方案 »

  1.   

    查询的时候ViewState保存
      ViewState["Time"]=textBox1.Text
    Page_load事件中判断viewstate是否为null
    if(ViewState["Time"]!=null)
        textBox1.Text=ViewState["Time"].ToString()
      

  2.   

    是用的HTML文本框 用dom来取得其值 也可以用这个?
      

  3.   

    按纽你是否也是用html控件?
    或者你可以在js中操作cookie 保存起来。
      

  4.   

    js操作cookie
      

  5.   

    是的 按钮也是纯HTML 我刚才问了下同事 他的做法是后台requset.form[""] 保存前台的值 页面刷新后再将这个值传给前台日期文本框- -
      

  6.   

    <input id="Text1" name="Text1" type="text" />
    <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    <script type="text/javascript">
        var str = "<%=str %>";
        document.getElementById("Text1").value=str;
    </script>    public string str;
        protected void Button1_Click(object sender, EventArgs e)
        {
           str = Request.Form["Text1"];
        }
      

  7.   

    按钮如果也是html控件的话那就操作cookie吧。