Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はradlistviewを持っています。page_load 時に listview にデータソースを追加します。しかし、同じページでIボタンをクリックすると。リストビューのデータソースを失いました。なんで?どうすれば修正できますか?
リストビューのデータバインディング コードを次のように入れてみてください。
protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { myListview.DataSource = myDatasource; myListView.DataBind(); } }
ページ全体ではなくページの一部のみをポストバックする場合は、UpdatePanels の使用を検討することもできます。