Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9120909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:44:08+00:00 2026-06-17T05:44:08+00:00

Well, the question is very simple. I’ve got an webkit browser in an class

  • 0

Well, the question is very simple.

I’ve got an webkit browser in an class file generated this way:

public static WebKit.WebKitBrowser mainBrowser = new WebKitBrowser();

Now I’m trying to login on an website automaticly. But the input fields aren’t filled in.

I’m using this code to get to the point where the data needs to be filled in:

public void loginthen()
{
    this.Controls.Add(globalVars.mainBrowser);
    globalVars.mainBrowser.DocumentCompleted += 
        new WebBrowserDocumentCompletedEventHandler(mainBrowser_DocumentCompleted);
    globalVars.mainBrowser.Navigate("http://www.somesite.com/");                
}

void mainBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    var send = sender as WebKit.WebKitBrowser;
    if (send.Url == e.Url)
    {
        MessageBox.Show("Inloggen");
        globalVars.mainBrowser.Document.GetElementById("user").TextContent = "User Name";
    }
}

The MessageBox is shown, and i get no error, but the input field isn’t filled in.

The HTML of the input fields is this:

<input id="user" name="user" class="text" type="text" value="" onkeydown="if((e=window.event||event) &amp;&amp; e.keyCode == 13 &amp;&amp; $('#user').val() &amp;&amp; $('#password').val()) $('#login_button').trigger('click');">

So my thought was… Am I using the TextContent wrong?

And can this (and triggering the button and so on) not be much easier be done with javascript?

So I googled and searched for it, but the only thing that I can find is how to call C# function from javascript or how to call an javascript function from C#. But I don’t own these sites, so that won’t work…

So what are your thoughts about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:44:10+00:00Added an answer on June 17, 2026 at 5:44 am

    Instead of:

    globalVars.mainBrowser.Document.GetElementById("user").TextContent = "User Name";
    

    you should use:

    globalVars.mainBrowser.Document.GetElementById("user").SetAttribute("value", "User Name");
    

    You may use the TextContent property to set the content of a HTML tag such as <p />, <span /> or maybe <div />.

    globalVars.mainBrowser.Document.GetElementById("myDiv").TextContent = "some div content";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry this is not a very well defined question, I am thinking about an
Well, very simple question. So that's good news for you, I guess. More thorough
This is likely a very simple question with a straightforward answer but I'm something
This is my first question here, probably a very simple one but I can't
my question is very simple for those who know the job very well. How
I have a very simple question. Is there any way to relate database errors
Well, my question is very simple but a little hard to accept the solution,
Well, my question is very simple, i just wanna convert the output of imagepng
I'm sure this is a very simple question, but I'm just a newbie so...
This is a very simple question, and I apologize for being so noobish :/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.