Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2006, 05:19 PM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default Stop Databinding on Page_Load

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
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
 
Old February 20th, 2006, 07:05 PM
Registered User
 
Join Date: Feb 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old February 28th, 2006, 08:11 AM
Friend of Wrox
 
Join Date: Oct 2005
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop button won't stop loop JDShaffer Visual Basic 2008 Essentials 3 May 23rd, 2008 03:22 PM
Page_Load question wayneamurphy BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 4 November 6th, 2006 03:54 AM
Page_Load not working! New2ASPnet General .NET 6 July 28th, 2004 01:53 PM
forcing a page_load ? Rashe ASP.NET 1.0 and 1.1 Basics 2 February 16th, 2004 10:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.