Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

VB.NET
how to send gridview containing image via email using asp.net c#?


I am using this code for render Gridview:-

C#
public string GetGridviewData(GridView gv)
    {
        StringBuilder strBuilder = new StringBuilder();
        StringWriter strWriter = new StringWriter(strBuilder);
        HtmlTextWriter htw = new HtmlTextWriter(strWriter);
        gvRecords.RenderControl(htw);
        return strBuilder.ToString();
    }


but only text displayed, image did not display.

Content only displaying but image is not displaying.
How it can be resolve?
Please help me.

Thanks in Advance.

Ankit Agarwal
Software Engineer
Posted
Updated 23-Nov-15 1:26am
v2
Comments
Arasappan 23-Nov-15 7:28am    
U want to send whole grid or image only..
Agarwal1984 23-Nov-15 7:36am    
i want to send whole grid:-

TileImage|Desc1|Desc2
~/img/abc.jpg|ABC1|ABC2

image should be display in TileImage column.
but image is not displaing in email.

TileImage|Desc1|Desc2
x|ABC1|ABC2

its only displayed in email.

So, how can be display in tileimage column?

1 solution

Your image URLs should be Absolute URLs instead of Relative.

Otherwise embed your images inside mail, refer - Sending Email Using Embedded Images[^].
 
Share this answer
 

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