本当にこれのために助けが必要です。私はAjaxControlToolkit.TabContainer
を使用し、ASP.NET Framework 4.0
を使用しています。グリッドビュー、テキストボックス、およびボタンは、aspページのTabContainerに配置されます。私はボタンを押すと、ポストバックは起こりますが、データテーブルやテキストボックスのコンテンツへのバインディンググリッドビューも更新されません。ポストバックは、テストボックスやgridviewの内容を更新しません
私はコードをデバッグして、私がボタンポストバックを押して、コンテンツが新しい値で割り当てられたgridviewとtextboxの値でいっぱいになることを発見しました。値はページに表示されません。私はなぜそれが起こっているのか知りません。助けてください。
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
if (ListBoxCustomer.Items.Count != 0)
{
int[] _selectedItems = ListBoxCustomer.GetSelectedIndices();
string _comma = "";
string _custID = "";
InitializeConnection();
if (_selectedItems.Length != 0)
{
foreach (int i in _selectedItems)
{
_custID = _custID + _comma + ListBoxCustomer.Items[i].Value;
_comma = ",";
}
if (custObj != null)
{
//DataTable _dt = new DataTable();
DataSet _ds = new DataSet();
GridViewCustomer.Visible = true;
GridViewCustomer.AutoGenerateColumns = true;
_ds = custObj.GetSelectedCustomers(1, _custID);
GridViewCustomer.DataSource = _ds.Tables[0];
GridViewCustomer.DataBind();
TextBoxTest.Text = GridViewCustomer.Rows.Count.ToString();
TextBoxTest.Text = "test";
}
}
}
}
}
ありがとう。
GridViewCustomerとGridViewCustomerをUpdatePanelに配置しますか? –
そのTabContainerのUpdatePanelにはありません。 – sonia