Thursday, October 17, 2013

refresh dropdown list with out change stateview in asp.net


---------------in page load ------------------------------------------------------------------------
 //craete view stat object carry the selected data on dropdownlist

  ViewState["DropDownList3"] = DropDownList3.SelectedValue;

--------------------------in the event button ---------------------------------------------------------
  protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
        {
       
// on the event fire now will refersh the dropdown datat and keep the state view
            DropDownList3.DataBind();

            if (ViewState["DropDownList3"] != null)
            {
              

                DropDownList3.SelectedValue = ViewState["DropDownList3"].ToString();
            }
        }

No comments:

MS in Computer Science with paid training in USA company