On 27.09.2011 12:10, Builder wrote:
> Hello,
>
> I have a problem to load URL containing fragment into UIWebView. I want to
> load a local html file into UIWebView. I tried to do it in this way:
>
> NSUrl url = NSUrl.FromFilename(@"/Users/gep/Library/Application
> Support/iPhone
> Simulator/4.3/Applications/582D1D4E-9496-4352-8CE1-8520A842FBA8/Documents/Content/Hermes_filter/Ergaenzendes/index.htm#home");
>
> But without any success. But when I used url without fragment, it worked
> correctly:
NSUrl.FromFile does exactly what it was told to do: If you specify
"index.htm#home", it will assume you want the *file* with the name
"index.htm#home". The same applies to query params (?foo=bar&bazz).
Try
NSUrl.FromString(NSUrl.FromFile("index.html").AbsoluteString + "#home");
I did not test it, but I believe .AbsoluteString will return a
file-schema URL, which you can feed to NSUrl.FromString together
with the trailing fragment.
Robert
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch