Displaying "Sorry there were no results for your search" for a search that yields no results

Hello,

I've got an SQL datasource and a GridView control on a page called textsearch.aspx (in a VS web application). The text that the user is searching for is passed in as a querystring - e.g. if the user searches for "clematis" he's navigated to textsearch.aspx?Search=clematis. This all works fine as long as there is something that's called "clematis" (or whatevers being search for) in my database. However, if there are no matches in my database nothing is displayed (except for what's on my master page).

I need to be able to display a message which says something to the effect of "Sorry there were no results for your search" if there are no matches in my database. Could someone please tell me how I can achieve this?

Many thanks,

Luke

0
luke_jack61188
7/8/2006 3:59:28 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
1004 Views

Similar Articles

[PageSpeed] 4
Get it on Google Play
Get it on Apple App Store

There is an EmptyDataText property for the gridview, If you need to customize it more than text you can use the EmptyDataTemplate

0
justin0501
7/8/2006 11:14:35 PM
Reply:

Web resources about - Displaying "Sorry there were no results for your search" for a search that yields no results - asp.net.presentation-controls

Resources last updated: 12/26/2015 5:46:39 AM