Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
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:
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 31-Jan-13 6:23am
Edited 31-Jan-13 6:25am
(no name)500.7K
v2
Comments
ryanb31 at 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 at 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" />
ryanb31 at 4-Feb-13 7:48am
   
It sounds like the url for the image is wrong.
Gerenatian at 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
0 Sergey Alexandrovich Kryukov 418
1 Sascha Lefévre 270
2 Abhinav S 170
3 Maciej Los 160
4 Richard Deeming 160
0 Sergey Alexandrovich Kryukov 7,096
1 OriginalGriff 6,395
2 Maciej Los 2,782
3 Abhinav S 2,732
4 Peter Leow 2,694


Advertise | Privacy | Mobile
Web02 | 2.8.150414.1 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100