# Other .NET Programming > Windows Presentation Foundation (WPF) & XAML forum >  how to set Source of webbrowser to static string?

## F Scheltens

Hi,

im trying to set the source of a webbrowser to a static string, but when i run it i get an exception. Can anyone tell me why?



```
<Window x:Class="FlowDocTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:clr="clr-namespace:System;assembly=mscorlib"
        xmlns:local="clr-namespace:FlowDocTest"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <clr:String x:Key="gg">http://www.google.nl</clr:String>
    </Window.Resources>
    <Grid>
        <!-- This throws an exception -->
        <WebBrowser Source="{StaticResource gg}"/>
        <!--This works:WebBrowser Source="http://www.google.nl" -->
    </Grid>
</Window>
```

----------


## F Scheltens

Ok i found out what i was doing wrong:"Apparently the inner-exception was: Cannot convert string to URI. 

So here is the corrected sample:



```
<Window x:Class="FlowDocTest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:sys="clr-namespace:System;assembly=System"
        xmlns:local="clr-namespace:FlowDocTest"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
     <Grid>
        <Grid.Resources>
            <sys:Uri x:Key="strHTML">D:\Manual.html</sys:Uri>
        </Grid.Resources>
        <WebBrowser Source="{StaticResource strHTML}"/>
    </Grid>
</Window>
```

----------

