protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            int index;
            int.TryParse(Request.QueryString["id"],out index);
            if (index > 0)
            {
                ControlParameter c = new ControlParameter("ID", TypeCode.Int32, "GridView1", "SelectedValue");
                c.DefaultValue = index.ToString();
                this.SqlDataSource2.SelectParameters.Clear();
                this.SqlDataSource2.SelectParameters.Add(c);
                this.DetailsView1.ChangeMode(DetailsViewMode.Edit);
            }
        }
    }
    protected void DetailsView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
    {
        Response.Redirect("Default2.aspx?id=12");
    }

相关文章:

  • 2021-12-08
  • 2021-12-24
  • 2022-12-23
  • 2021-11-28
  • 2022-01-12
  • 2021-08-19
  • 2021-08-23
  • 2022-12-23
猜你喜欢
  • 2021-05-21
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2021-09-27
相关资源
相似解决方案