|
Subject:
|
Stop Databinding on Page_Load
|
|
Posted By:
|
rit01
|
Post Date:
|
2/20/2006 4:19:31 PM
|
Hi
I have a search page which consists of a formview control (textbox, button) and a gridview for the search results. These controls are bound to an SQLDataSource with the default value within the control parameter set to % (to use wildcard within my stored procedure).
Is there any way of stopping the databind on Page_load rather than my gridview filling up with the wildcard results initially.
Ta
Rich
|
|
Reply By:
|
ethertt77
|
Reply Date:
|
2/20/2006 6:05:38 PM
|
i dont know if this answers your question, but u can try using a "if (Page.IsPostBack)" in the Page_Load function. This will run stuff only if its because of postbacks, and not when the page is loaded up initially.
|
|
Reply By:
|
rit01
|
Reply Date:
|
2/28/2006 7:11:10 AM
|
Thanks ethertt77. That is excatly what I used.
I set the default parameter for my SQLDataSource SelectParameters to something that wouldn't return any results depending on the status of the Page.IsPostBack.
Ta
Rit
|