Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 替换Sitecore媒体库链接中的空白_C#_.net_Sitecore_Sitecore6 - Fatal编程技术网

C# 替换Sitecore媒体库链接中的空白

C# 替换Sitecore媒体库链接中的空白,c#,.net,sitecore,sitecore6,C#,.net,Sitecore,Sitecore6,W3C验证我的页面时,我收到以下错误: Bad value /~/media/Image Libraries/Carousel Images/sea.jpg?w=652&h=263&bc=transparent&as=1&thn=1 for attribute src on element img: Whitespace in path component. Use %20 in place of spaces. 管道中是否有这样的地方,我会在渲染之前更改这些链

W3C验证我的页面时,我收到以下错误:

Bad value /~/media/Image Libraries/Carousel Images/sea.jpg?w=652&h=263&bc=transparent&as=1&thn=1 for attribute src on element img: Whitespace in path component. Use %20 in place of spaces.
管道中是否有这样的地方,我会在渲染之前更改这些链接

编辑:

这是一个示例图像标记:

<img width="257" height="155" src="/~/media/Image Libraries/Section Pods/headphonewoman.jpg?w=257&h=155&bc=transparent&as=1&thn=1" alt="Administration">

我们还尝试在
Sitecore.Resources.Media.MediaProvider
中添加一个覆盖
GetMediaUrl
的管道,但这没有帮助。

您可以
web.config
节点下执行此操作:

<encodeNameReplacements>
  // ..
  <replace mode="on" find=" " replaceWith="%20" />
  // ..
</encodeNameReplacements>

// ..
// ..

在上下文中列出片段以及确切的错误消息。这对我们有用。
<encodeNameReplacements>
  // ..
  <replace mode="on" find=" " replaceWith="%20" />
  // ..
</encodeNameReplacements>