inside my code, after researching through Formview, I need to call listview.databind, and this makes it impossible to receive Formview data, even if it still appears on the screen. this is my code
protected void DemandeSearchFormView_ItemInserting(object sender, FormViewInsertEventArgs e) { ListView listview = (ListView)panelPagination.FindControl("listdeclarations"); ViewState["search"] = "search"; listview.DataBind(); }
databind () usually calls this method
public DeclarationGeneraleBean RechercheByCritere() { DeclarationGeneraleBean declarationBean = new DeclarationGeneraleBean(); declarationBean.IdService = (int) Session["idService"]; if (ViewState["search"] != null) { TextBox numOrdre = (TextBox)DemandeSearchFormView.FindControl("numtxt");
}
ViewState ["search"] is null, I donβt know why ?? databind () seems to reload the page or something like that. Does anyone have an idea how to handle this?
source share