Hi all, i am developing a e-commerce web application. I have a web page with a grid view content products , paging=true . When i order ,for example, order by price, it works fine but only in the first page because when i change in second page, it lost the order by command and doesn't order by. How can i fix this ?
EmanuelPirovano[^] wrote in the comment to the question:C# SqlDataSource1.SelectCommand = "SELECT ID, NomeProdotto, DescrizioneProdotto, PrezzoProdotto, Data , Quantità FROM aProdotti WHERE NomeProdotto like '%" + TextBox1.Text + "%' OR DescrizioneProdotto like '%" + TextBox1.Text + "%' ORDER BY PrezzoProdotto ASC" This is the sql search-order by function and it works only in the first page of grid view, when i switch into 2 page, it lost the sql command and set as random the items.
SqlDataSource1.SelectCommand = "SELECT ID, NomeProdotto, DescrizioneProdotto, PrezzoProdotto, Data , Quantità FROM aProdotti WHERE NomeProdotto like '%" + TextBox1.Text + "%' OR DescrizioneProdotto like '%" + TextBox1.Text + "%' ORDER BY PrezzoProdotto ASC"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)