Last post May 30, 2020 10:00 AM by lucsil100
May 29, 2020 10:37 AM|lucsil100|LINK
I have a Gridview that has as datasource the standard SqlDataSource1. A user can change the query based on a dropdown and this works fine. But when there is no result the whole gridview disappears. This is the code that gets activated when the dropdown
is changed, it's fairly simple but to just give an example on what I am doing:
SqlDataSource1.SelectCommand = "SELECT * from Kist where Rij ='" + DropDownList1.Text + "'";
If there are no results with the 'Rij' column the Gridview disappears. I want it to stay, so the user does not have to refresh the page to be able to use it again.
By the way, yes I know my query is easy recipe for a SQL Injection. The project is only for private use.
May 30, 2020 10:00 AM|lucsil100|LINK
I already discovered the problem myself. Because there is no page reload the Gridview can't come back. So I just removed the Updatepanel and everything works fine now.