c# - WebBrowser Control update hidden field -


I'm trying to change the value in the hidden field in the webbrowser control.

I can inject a warning box that displays JavaScript. I can show the alert box to the current value of the hidden area. However, I can not get to change the price of the hidden area

I have tried to change the value (TB Webbroser control) by doing this:

  HtmlElement head = tb.Document.GetElementsByTagName ("head") [0 ]; HtmlElement script EL = TB Document Crate Element ("script"); IHTMLScriptElement element = (IHTMLScriptElement) scriptEl.DomElement; Element.text = "function doIt () {document.getElementById ('Test Hydfied'). Value = 'Hello World'; Warning ('Update');}"; Head.AppendChild (scriptEl); Tb.Document.InvokeScript ("Chart");   

The above warning pops up.

And I have tried to:

  tb.Document.Body.InnerHtml = Tb.Document.Body.InnerHtml.Replace ("MyValue", "YourValue ");   

In the above I see that InHHMM changes during debugging.

However, the value will never change when the page is loading and I am viewing the source.

Also, though I can inject JavaScript and pop up this warning, I am never able to find javascript int.

What's going on? What am i doing

Thank you!

Update:

  • I am doing this document in a compilation event.

  • I'm not using the viewsto

    Another update:

    I have a This area added a non-hidden text field this time.

      & lt; Input type = "hidden" id = "TestHiddenField" value = "MyValue" name = "TestHiddenField" /> & Lt; Input type = "text" id = "testField" value = "myValue" name = "TestField" />   

    This is when I do this:

      tb.Document.Body.InnerHtml = tb.Document.Body.InnerHtml.Replace (" MyValue "," Your Velocity ");   

    When the webbrowser reads the page in control, the text box displays the text "YourValue", but when I look at the source, the value is still equal to "MyValue" .

    What's up with that?

    Any thoughts?

    Thanks again!

    Unless the page is loading after you will have to wait for Document Compiled Event to fire.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -