日期:2014-05-20  浏览次数:20346 次

一个小问题可是就不知道去怎么做。。急急
我在A.aspx中添加了B.ascx
B.aspx中还有个按钮。
ascx的中有
        protected   void   Page_Load(object   sender,   EventArgs   e)
        {
            StreamReader   st   =   new   StreamReader (@ "D:\111.txt ",System.Text.Encoding.Default);
              string   aaa   =   st.ReadToEnd();
                Response.Write(aaa);
                st.Close();
        }
A.aspx中的按钮
        protected   void   Button1_Click(object   sender,   EventArgs   e)
        {
              StreamWriter   sw   =   new   StreamWriter(@ "D:\111.txt ");
                sw.Write( "bbbb ");
                sw.Close();
                Response.Redirect(Request.RawUrl);
        }
文本111.txt中原有内容是“aaaa”,
当我点一次按钮时候,只能看到输出的“aaaa”,不知道有何办法能输出 "bbbb ",也就是说在执行完Button1_Click后能让B.ascx从新读取文本内容并输出,但是我不能用Response.Redirect(Request.RawUrl);大家有什么办法吗?


------解决方案--------------------
顶,这种局部刷新BT