tags:

views:

420

answers:

3

Hi,

i got the problem that the HTMLWorker.ParseToList function will throw an exception ( 404 - not found ) when a tag like:

<img alt="none" src="/image.jpg" />

has a deadlink in the src... i'd like it to just not load the image and go on...

Does anyone now a way to configure this or has similar solution in mind?

A: 

You can extend HTMLWorker to include a filter to remove (or substitute) whichever HTML elements you want before passing your HTML to your extended HTMLWorker's ParseToList() method.

Jay Riggs
A: 

The path must be absolute ex: c:\images\image.jpg

You can do it with

Server.MapPath(relativeUrl)
luca.kenny
A: 

look into this thread

http://www.draggerco.com/node/2

works great for me...

i just replaced

string siteUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(HttpContext.Current.Request.Url.AbsolutePath, "");

with

string siteUrl = HttpContext.Current.Server.MapPath([your_path_for_images_in_string]);

** Note: for this, use HtmlWorker.Parse() method

Arsalan