Click here to Skip to main content
15,920,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i will click on one link then i have to disply a grid which is on one page.if grid is empty then i have to disply another page on clicking same link.
Posted
Updated 13-Jun-12 23:57pm
v2

Hi,

You need to write click event of your LinkButton.

on click of the button if your grid datasource is empty then show another page otherwise your grid will be there.

Creating GridView dynamically :
how to create columns dynamically in a grid view[^]

if you do not know about click event then first start reading asp.net books.

thanks
-Amit.
 
Share this answer
 
C#
if ((_DS.Tables[0] != null) && (_DS.Tables[0].Rows.Count >= 1))
            {
               
                GridViewRechargeReport.DataSource = _DS;
                GridViewRechargeReport.DataBind();
                ImageButton1.Visible = true;
            }
            else
            {
                lblErrorMessageRechargeReport.Text = "There have none transaction";
                lblErrorMessageRechargeReport.BackColor = System.Drawing.Color.Red;
                
            }
 
Share this answer
 
Comments
Sandeep Mewara 14-Jun-12 11:40am    
How does the answer does what is asked for?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900