3
Answers

C# Click Gmail Refresh Button

Photo of eric martin

eric martin

14y
2.5k
1

I am writing a simple personal app that has a browser control and I want it to automatically "Refresh" gmail to check it more often than it does by default. There are monkey scripts that do this but I'm trying to add my personal style to it.

Anyhow, I've looked around and found everything but what I can do in csharp using the browser control.

I found this:

       // Link the ID from the web form to the Button var
theButton
= webBrowser_Gmail.Document.GetElementById("Refresh");

// Now do the actual click.
theButton
.InvokeMember("click");
C#

But it comes back with null in 'theButton' so it doesn't invoke anything.

Anyone have any suggestions?

Thanks again!

Answers (3)

0
Photo of Dipen Lama
NA 331 195.9k 18y
Use Place holder control to place the user control dynamically.
Here is some lines:

    string userControlName = "UserControl1.ascx"; 
 
    Control control1 ;
    control1 = LoadControl( userControlName );
    placeHolderControl1.Controls.Clear();
    placeHolderControl1.Controls.Add( control1 );