在GridView中DataGrid1_ItemDataBound() 加了个
 Attributes.Add("OnClick","location.href='Curreny.aspx?id=" + UnitID + "'"). 这样向当前页面传个参数.即向自己提交。现在这样做好象是重新unload当天页面。我要的是PostBack().
现在在哪个脚本怎么样修改达到提交效果而非重新load?

解决方案 »

  1.   

    当天页面有个GridView用来显示数据. 还有个Panel控件(里有几个TextBox等),用来编辑数据的.
    其中Panel只是在编辑状态下才显示的. 所以当我在Gridview中加了上个脚本。这样在 
    Page_Load(object sender, System.EventArgs e)
    {
     if (!IsPostBack)
         {  //第一次load页面 处理绑定及其它事件
          }
      else { 进入编辑状态 }
    }
     中每次脚本执行时, 都是重新load页面,即IsPostBack=false . 
    现在我想要的是. 脚本每次执行时都是: IsPostBack=true.
      

  2.   

    protected void gvSelectKeyCompanys_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowIndex > -1)
                {
                    e.Row.Cells[1].Text = "<a target='_blank' href='KeyCompanySelectKeyRequests.aspx?KeyWordName=" + e.Row.Cells[1].Text + "'>" + e.Row.Cells[1].Text + "</a>";//传参数
                    e.Row.Cells[2].Text = "<a target='_blank' href='../BIZ/BIZBrowse.aspx?CompanyID=" + ds.Tables[0].Rows[e.Row.RowIndex][4].ToString() + "'>" + e.Row.Cells[2].Text + "</a>";
                }
            }
            catch (Exception ex)
            {
                this.lblMessage.Text = ex.Message;
            }
        }