Hi,
try this...
//Code to get the datasource dataset ds
if(ds.Tables[0].Rows.count > 0)
{
Page.ClientScript.RegisterStratUpScript(this.GetType(),"showal","ShowGridOrLabel();",true);
}
and you Js should be...
function ShowGridOrLabel()
{
if(confirm("Are you sure you want ot show grid") == true)
{
document.getElementById('Gridview1').style.dispaly='block';
document.getElementById('label1').style.dispaly='none';
}
else
{
document.getElementById('Gridview1').style.dispaly='none';
document.getElementById('lable1').style.dispaly='block';
}
}