Results 1 to 3 of 3

Thread: [RESOLVED] For / Next / invokescript - Javascript

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2010
    Posts
    6

    Resolved [RESOLVED] For / Next / invokescript - Javascript

    I am trying to put the following command into a FOR / NEXT loop but I can't parse the variable correctly

    The first line looks like this:

    If Not WebBrowser1.IsBusy = True Then WebBrowser1.Document.InvokeScript("__doPostBack", New Object() {"dnn$ctr958$CE_ActiveSocial_Contacts$GridView1", "Page$2"})

    I want to count through several pages, so I want to replace the page variable with an integer that counts up. Like the following:

    If Not WebBrowser1.IsBusy = True Then WebBrowser1.Document.InvokeScript(variable)

    I have tried mixing a string and an object variable together, but I haven't had any luck.

    rString = (Chr(34) & "__doPostBack" & Chr(34) & ",")
    sString = ("Page$2") ''or a reference to a string and an integer variable
    oObject = New Object() {"dnn$ctr958$CE_ActiveSocial_Contacts$GridView1", sString}

    to give:

    If Not WebBrowser1.IsBusy = True Then WebBrowser1.Document.InvokeScript(rString & oObject)

    Can anyone provide any pointers as to what I can do to get the page number to increase in a variable? I have tried using the whole section as a String and this doesn't work either....
    Last edited by biter; Dec 28th, 2010 at 08:44 PM.

  2. #2
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: For / Next / invokescript - Javascript

    This doesn't work?

    vb Code:
    1. Dim PageNumber as Integer = 0
    2. If Not WebBrowser1.IsBusy = True Then WebBrowser1.Document.InvokeScript("__doPostBack", New Object() {"dnn$ctr958$CE_ActiveSocial_Contacts$GridView1", "Page$" & PageNumber & ""})

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2010
    Posts
    6

    Re: For / Next / invokescript - Javascript

    Thank you so much. This works very well. And now on to the next problem...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width