Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Going at the end of a browser page
Message
De
07/01/2005 17:23:43
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
00974921
Message ID:
00975285
Vues:
21
>I have done some testing for myself. And I did the next that worked for me, look if you can adjust to your needs:
>
>Assume you navigate first to a blank.html,having the following tags, delete the quotes for :
>
>"<html>"
>"<head>"
>"<script>"
> function Go(){
>      DivGoTo.scrollIntoView(true);
>      }
> 	
>	
>"</script>"
>
>"</head>"
>"<body>"
>
>"<div id ="DivInner">  </div>"
>"<div id ="DivGoTo"> </div> "
>
>"</body>"
>
>"</html>"
>
>
>
>In the DivInner section you can place with DOM your innerHTML and afterwards you can fire the script that goes to DivGoTo section thatcomes after DivInner section .To do this I placed a webbrowser and a button on the form.
>
>After the button is clicked the webbrowser navigates first to the blank.html, afterwards it creates 1000 lines that is putted in a cBigFile string.
>Finally the cBigFile string would be putted in the DivInner section and the javascript is fired such that it goes to the end of the document. Fast and dirty code:
>
>
>namespace WindowsApplication1
>{
>    partial class Form1 : Form
>    {
>
>
>        string cBigFile = "<pre>";
>
>       private void button1_Click(object sender, EventArgs e)
>            {
>            webBrowser1.Url = @"c:\weggooi\blank.html";
>
>            for (int i = 1; i <= 1000; i++)
>            {
>                cBigFile = cBigFile + "\n" ;
>            }
>            cBigFile = cBigFile + "</prae>";//prae = actually pre
>
>
>        }
>
>
>
>
>\\  to write innerhtml and fire the script to go the end section after the:
>\\ document is completed
>        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
>        {
>
>            webBrowser1.Document.GetElementById("DivInner").InnerHtml = cBigFile;
>            webBrowser1.Document.InvokeScript("Go");
>        }
>
>    }
>}
>
InvokeScript() is not a method of the WebBrowser.Document object.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform