c# - SqlDataSource not reselecting data from database when data is changed -


i have dropdown list being populated sqldatasource, following markup:

dropdown:

<asp:dropdownlist id="saleiddropdown" runat="server" cssclass="dropdown"      datasourceid="dropdowndatasource" datatextfield="title" datavaluefield="id"     appenddatabounditems="true"> </asp:dropdownlist> 

datasource

<asp:sqldatasource id="dropdowndatasource" runat="server"      connectionstring="<%$ connectionstrings:sql-dev %>"      selectcommand="select [id], [title], [userid] [adselect]"> </asp:sqldatasource> 

the problem i'm running when of data changed via web interface i'm making (i delete item, or change it's title example) dropdown populates old data, though has changed in database (i checked using sql server studio). if reload page, then dropdown populated correctly.

i need way "force" refetching/selecting of data, efforts have far failed. i've tried doing in code, it's not taking effect.

dropdowndatasource.select(datasourceselectarguments.empty); dropdowndatasource.databind();  saleiddropdown.databind(); 

it still doesn't update dropdown, when run.

how can make dropdown , sqldatasource , push page on command?

pls note though solution disabling viewstate works far optimal because load data database on every postback.

if it’s busy website don’t want that. try spending more time on saleiddropdown.databind(); command. must refresh data guess you’re not doing in correct place or that…


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -