This is a migrated thread and some comments may be shown as answers.

Navigate to bookmark

3 Answers 75 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Dan Normington
Top achievements
Rank 1
Dan Normington asked on 29 Jun 2009, 06:53 PM

There are times that I need to have the html placeholder control scroll to a bookmark within my content. This seems to work just fine in Internet explorer, but doesn't in Firefox and Chrome. I'm using the following Method within the silverlight c# code once the data has been bound to the placeholder control.

HtmlPage.Window.NavigateToBookmark(bookmark);

I have also tried invoking javascript methods from the silverlight application such as scrollIntoView once I have the element, but this doesn't work either.

The interesting part is that within FireFox and Chrome I see the content initially scroll to the bookmark in the content, but then it ends up scrolling right back up to the top of the page immediately after. Is this a known behavior?

Thanks in advance.

 

 

 

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Dan Normington
Top achievements
Rank 1
answered on 01 Jul 2009, 06:40 PM
Now I'm finding that it isn't working within Internet Explorer as well. After doing some testing It seems to be a timing issue. If I put an alert popup prior to the HtmlPage.Window.NavigateToBookmark(bookmark); method call it seems to work OK. Is there any event on the placeholder control that tells me that it has completed all rendering/loading?
0
Valentin.Stoychev
Telerik team
answered on 03 Jul 2009, 10:10 AM
Hi Dan Normington,

Sorry for the late response to your problem.

We can't get a notification about when the html is rendered in the browser. You can solve your problem by using a timer to check when anchor is already rendered. Please check the attached solution and let us know if you need more info.

Best wishes,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dan Normington
Top achievements
Rank 1
answered on 03 Jul 2009, 04:02 PM
Thanks for the response. I ended up writing my own html host control that appears to be working in firefox, IE, and chrome. Bookmarks are scrolled to correctly in all versions.
Tags
HTMLPlaceHolder
Asked by
Dan Normington
Top achievements
Rank 1
Answers by
Dan Normington
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or