Click here to Skip to main content
15,884,821 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello everyone,

I am rendering an asp.net page to html using PageRender. the problem is that the images in asp.net page doesnot get rendered, i mean after rendering to html file, when i open an html file i cant see the images there. the code i am using is as below:
VB
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

        Dim sb As New StringBuilder()
        Dim hWriter As New HtmlTextWriter(New StringWriter(sb))
        MyBase.Render(hWriter)
        Dim PageResult As String = sb.ToString()
        writer.Write(PageResult)
        Dim file As New System.IO.StreamWriter(Server.MapPath("~\UploadedDocs\") & "InvoiceDetail" & Request.QueryString("ClientJobID") & ".html")
            file.WriteLine(PageResult)
            file.Close()
 End Sub

Can any one please guide me how to get image also

Thank you in advance
Posted
Updated 31-Jan-13 5:25am
v2
Comments
ZurdoDev 31-Jan-13 11:38am    
Are the image placeholders there, you just don't see the image? What happens when you view the source html?
Jagdish.rkl 3-Feb-13 11:18am    
Hello
yes i have the image placeholders there but image doesn't get displayed. it just displays the red cross over there. in html code i found it mentioning that file doesn't exists while the file exists in server.
it is how i am using it in my asp.net application to load the image

<img id="Img1" runat="server" src="../images/abc.jpg" border="0" height="50" width="90" alt="INTEC Office" />
ZurdoDev 4-Feb-13 7:48am    
It sounds like the url for the image is wrong.
Gerenatian 31-Jan-13 12:06pm    
I have the same question as ryan, Can you see the image placeholders. If so, it could be a problem how you are using the picture. Setting it as a resource / content could mean a big difference.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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