Display an Image when the GridView has no data in asp.net c#


Many times we want to show an image, when grid view is empty or gridview has no data. We already know EmptyDataText property where we can show only Text but if we want to more control likes Image, hyperlink etc.

Then we have use EmptyDataTemplate   property in source  code likes below
<EmptyDataTemplate>
                                    <asp:Image ID="imgOne"
                                        ImageUrl="~/images/no msg.jpg"
                                        AlternateText="No results"
                                        runat="server" />
              
</EmptyDataTemplate>



`

Display an Image when the GridView has no data in asp.net c# Display an Image when the GridView has no data in asp.net c#  Reviewed by NEERAJ SRIVASTAVA on 11:53:00 AM Rating: 5

1 comment:

  1. This content creates a new hope and inspiration with in me. Thanks for sharing article like this. The way you have stated everything above is quite awesome. Keep blogging like this.




    DotNet Training in Chennai Adyar

    ReplyDelete

Powered by Blogger.