RadEditor for ASP.NET AJAX

RadControls Send comments on this topic.
Stripping Image and Anchor Paths
See Also
Controls > RadEditor > Dialogs > Examples > Stripping Image and Anchor Paths

Glossary Item Box

TASK

You may require that URLs (both href and src) are expressed as full paths, instead of the default relative paths.

SOLUTION

RadEditor includes a new content filter MakeUrlsAbsolute that makes all URLs (href and src) in the editor content absolute (e.g. http://server/page.html instead of "page.html"). MakeUrlsAbsolute is disabled by default. To enable this filter, assign the filter to the RadEditor ContentFilters property:

[C#] Setting MakeUrlsAbsolute Content Filter Copy Code
protected void Page_Load(object sender, EventArgs e)
{
   
if (!IsPostBack)
   {
       RadEditor1.ContentFilters = Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute;
   }
}
[VB] Setting MakeUrlsAbsolute Content Filter Copy Code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
 If Not IsPostBack Then
  RadEditor1.ContentFilters = Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute
 End If
End Sub
StripAbsoluteAnchorPaths and StripAbsoluteImagesPaths properties are no longer available in favor of the new MakeUrlsAbsolute filter.

Example

By default, an image path might look like the following example when viewed in HTML edit mode:

<img alt="" src="/images/mydownloads/WebPages001.png" />

With MakeUrlsAbsolute assigned to ContentFilters the path now shows the full path:

<IMG alt="" src="http://localhost:49573/images/mydownloads/WebPages001.png">

See Also