Click here to Skip to main content
15,847,077 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi friends,

am working on asp.net c#, Sqlserver 2005.

I have webform to add user records and attach the files, whatever i have attached it will add in folder(sol explorer) after attaching i will retrieve it and display in gridveiw.

I have a pdf attachments in gridview,
I have added a attachment image in template field, this image will show for all the rows of gridveiw.

This is my attachment.

ASP.NET
<asp:TemplateField>
                   &lt;HeaderStyle Width="20px" />
                   <ItemStyle Width="20px" />
                   <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" Text='<%# Bind("Attachment") %>' NavigateUrl='<%# Bind("Attachment", "AttachmentsTIP_Folder/{0}") %>' runat="server" ToolTip="View Attachment"
                    ImageUrl="~/User/ImagesUser/AttachmentIMG.png" />
                    </ItemTemplate>
                    </asp:TemplateField>


Suppose, if a pdf is not attached, if i click in gridview attachment image, it must display a message, "Sorry No attachment for this record"

can you please help me , how to do this ???

Thanks in advance.
Posted
Updated 14-Jul-13 2:00am
v2

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