Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have developed a web page hosted in internet; where in the first page it will accept some input values through textboxes and upon sendbutton ; those values will be sent to the second page in and get saved into dynamically created textboxes in second webpage.

I am developing a client side Windopws application with webbrowser control and I want to access the Textbox values saved in the second page which are dynamically saved by asp code.

Here is the second ASP page code hosted in Internet:-

<html>
<head>

</head>

<body>
<%

val1=Request.form("number1")
val2=Request.form("number2")

Response.write("<input type=text name=num1 id=num1 value=" + val1 + ">")

Response.write("<input type=text name=num2 id=num2 value=" + val2 + ">")

%>

</body>
</html>

My client side C# webbrowser control code to access the textbox values created in the above code when the Document Completed event triggers:-

void myWb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{

if (myWb.Url.ToString().ToLower().Contains("http://mywebpage.asp"))
{

MessageBox.Show(myWb.Url.ToString());

MessageBox.Show(myWb.Document.GetElementById("num1").InnerText);
MessageBox.Show(myWb.Document.GetElementByName("num2").InnerText.ToString());
}
}

But both the Message boxes displaying null only though the URL property displays the correct URL of the website currently displaying.

My Visual studio version is 2012.

Request your immediate help to fix this issue.

Thank You Very Much.
Updated 9-Mar-14 23:10pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900