想看看你的Page_Load内加载DataGrid数据的代码

解决方案 »

  1.   

    if Not IsPostBack then
        'DataGrid.DataBind()
    End if
      

  2.   

    在dg_update里面重新绑定,还没改变吗?
      

  3.   

    sub page_load
       bindgrid
    end sub
    =================================================
    sub bindgrid
            dim conn as new OleDbConnection(System.Configuration.ConfigurationSettings.AppSettings("dns"))
            dim objAdapte as OleDbDataAdapter=new OleDbDataAdapter("spassign",conn)
            objadapte.SelectCommand.CommandType = CommandType.StoredProcedure        dim ds as dataset=new dataset()        try
                conn.open
                objadapte.fill(ds,"assign")
               dg.DataSource = ds
               dg.DataBind()
            catch ex as OleDbException
                throw ex
            finally
                conn.close
            end tryend sub
      

  4.   

    if Not IsPostBack then
        'DataGrid.DataBind()
    End if
    是这个原因,请解释一下 acewang(**^o^**) 
    马上结分
      

  5.   

    在Page_Load中加上 if (!IsPostBack)
    {
        loadData
        .
        .
        .
    }
    因为点击任何链接或按钮后,先触发Page_Load,Page_Unload