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

  • Home
  • SEARCH
  • 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 7631619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:24:01+00:00 2026-05-31T06:24:01+00:00

I am working with a website that has javascript that does some changes on

  • 0

I am working with a website that has javascript that does some changes on the page load. However, when I load the page and handle the DocumentCompleted event, this change isn’t there. If I then continue paste the DocumentCompleted event, I can see the change happen. However I need this change to happen during DocumentCompleted so I can check some things.

Is there an other event I can subscribe to, or a way to cause the webBrowser to do all the javscript on page?

Edit: This is what I am talking about.

I loaded a sample page just to show you, and clicked the submit button with all fields empty to generate an the error.

Here is the result:

http://s8.postimage.org/zfv6stcar/sfsdfsdfds.jpg

Now if I take the HTML at that precise moment from that WebBrowser control, and render it somewhere else, those errors go away. The same thing happens when the server sends back those errors. If I handle the DocumentCompleted event and take the html, it isnt there. But after the event, it shows up in the control.

Hope you understand, it’s hard to explain.

  • 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-05-31T06:24:03+00:00Added an answer on May 31, 2026 at 6:24 am

    The problem seems to be that the DocumentCompleted event is being fired before the javascript. You should do some reading on how client side/server side things function.

    One option is to make a separate method for the DocumentCompleted event and call it form the javascript after it has been completed. This would get the sequencing of these events working properly, but is not very ideal.

    Alternatively, you could call the javascript code at the beginning of your DocumentCompleted event. The link below gives a pretty good explanation of how to go about that.

    http://forums.asp.net/t/1117189.aspx/1

    Personally, I would avoid using javascript and do the validation on the client side .NET, but I don’t know enough about the website to really say.

    EDIT:

    This should be the script you are looking for. Alternatively here is a thread related to your issue. Sorry I don’t have the exact code as I don’t have a project to test this on.

    http://msdn.microsoft.com/en-us/library/system.web.ui.clientscriptmanager.registerstartupscript.aspx

    Calling JavaScript Function From CodeBehind

    RE-EDIT:

    What is happening on the link you provided in the comments, is that each textbox is calling some javascript as well as the submit button. The best way to examine this is using the “Inspect Element” in the right-click menu on Google Chrome. For example, doing this on the textbox would show that it is registered with a few events:

    onfocus="$('f_tip_Username').style.display = 'inline'"
    
    onblur="$('f_tip_Username').style.display = 'none'"
    
    onchange="$('f_err_Username').style.display = 'none'"
    

    The first the element with the ID ‘f_tip_Username’, sets the display style of that element to inline (visible).

    The submit button calls the following:

    onclick="return o_edit_profile_form.validate()"
    

    Doing a find on “o_edit_profile_form” in the source code, you can find the exact javascript location that is being called. Enjoy!

    FINAL EDIT (hopefully?):

    Follow these steps: go to your site, right click and go view source. Do a find for “f_tip_Username”. This is the ID of one of the div tags being used. The third entry of it, should be a “div tag” that is used under the first textbox to warn of “min 3 characters”.

    You’ll notice above that in the code is a input type “text” with the Name “Username”. Notice the three events it has registered in it:

    onfocus="$('f_tip_Username').style.display = 'inline'" 
    onblur="$('f_tip_Username').style.display = 'none'" 
    onchange="$('f_err_Username').style.display = 'none'"
    

    These either hide or make visible, the div tag we found (f_tip_username) and also a separate div tag (f_err_Username) which is the error message div tag. Let me know if you are not able to find these in the source. Follow the steps I provided and you will find it in the “view source” OR in the DocumentText.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a website that has some images that I need
I'm working on a website that has a chat for a client, however, we're
I am working on a website that has Google charts, the website includes JavaScript
Working on a website that has Employee and Branch entities, using a database table
I am working on a website that has a menu which behaves correctly on
I am going to start working on a website that has already been built
I'm working on an existing custom control for an existing website that has to
I am currently working on a website which has a lot of javascript .
The page I am working on has a javascript function executed to print parts
I'm currently working on a website that works without any javascript. I'm going to

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.