Fill grid based on number of rows

  • Thread starter Thread starter Ed
  • Start date Start date
E

Ed

I have a new requisite from a client that wants to give the user the
option to about a databind based on number of returned rows.

if ds.rows.count < 1000 then
dg.databind()

etc.

They want a message box to popup and let the user choose to abort the
operation or let them continue with the long databind.

This is where I am at a loss as to how to display a popup asking the
user if he/she wants to continue with the long and memory intense
process. Get the value back from the popup, and bind the grid or
bypass the bind based on the return value.

Any help greatly appreciated.
 
Hi Ed
You can query the database for number of rows returned. If the rows
returned in above the specified limit use javascript confirm message box and
then continue with databind.
To display javascript alert use RegisterClientSide script.

Hope this is helpful.

Shailesh Jannu
MCSD .NET
 
Thanks for your quick response. Can you please give me a quick
example of how to call the javascript based on a certain criteria?

Thanks
 
Let me clarify my real problem:

I understand the registerclientside script. I understand placing it
as an attribute of a button. as in:

btnWhatEver.Attributes.Add("onclick", "return confirm(\"Whatever
Message\");");

or

btnWhatEver.Attributes.Add("onclick", "functionname()");

But the hurdle that my brain needs to overcome is the calling a script
from code, not a button event, and getting the return value from the
javascript:confirm dialog.

Thanks.
 
Sorry for the previous brain fart:

I should've put tags around the javascript.

This problem has me stumped.
 
Back
Top