>>>>半年多.NET总是觉得不爽really?try to move your data loading code insideif not postback then
'.........
end if

解决方案 »

  1.   

    在Page_load里用
    if not IsPostBack then
            '在此处放置初始化页的用户代码        Dim Fields_List = "comp_code;comp_name;comp_addr;post_code;rela_name;rela_phon;head_name;head_phon;fax;bank_no;belo_coun;belo_area;belo_prov;home_page;e_mail;comp_type;c_degree;comp_note"
            Dim s_arr() As String = {"userid", "comp_code", "comp_name", "comp_addr", "post_code", "rela_name", "rela_phon", "head_name", "head_phon", "fax", "bank_no", "belo_coun", "belo_area", "belo_prov", "home_page", "e_mail", "comp_type", "c_degree", "comp_note"}
            Dim s As String = MySubs.OledbReturnList("company", "in_id", Request("in_id"), False, Fields_List)
            If Len(Trim(s)) > 0 Then
                Dim v_arr() As String = s.Split(";")
                '如果找到则显示原始数据
                TextBox1.Text = v_arr(0)
                TextBox2.Text = v_arr(1)
                TextBox3.Text = v_arr(2)
                TextBox4.Text = v_arr(3)
                TextBox5.Text = v_arr(4)
                TextBox6.Text = v_arr(5)
                TextBox7.Text = v_arr(6)
                TextBox8.Text = v_arr(7)
                TextBox9.Text = v_arr(8)
                TextBox10.Text = v_arr(9)
                TextBox11.Text = v_arr(10)
                TextBox12.Text = v_arr(11)
                Textbox13.Text = v_arr(12)
                TextBox14.Text = v_arr(13)
                TextBox15.Text = v_arr(14)
                TextBox16.Text = v_arr(15)
                TextBox17.Text = v_arr(16)
                TextBox18.Text = v_arr(17)
            End Ifend if