WPF WebBrowser Control

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2009
Posts: 88
Reputation: nccsbim071 is an unknown quantity at this point 
Solved Threads: 6
nccsbim071's Avatar
nccsbim071 nccsbim071 is offline Offline
Junior Poster in Training

WPF WebBrowser Control

 
0
  #1
Oct 30th, 2009
I have a php website which i want to run in C# wpf webbrowser control.

I have a validated a username and password for the site by connecting to it's database using .net.

Now i want the functionality to take username and password and submit the post form to php page that will validate the username and password again(of course it is already validated) or not validate and send the user to the page that it needs to redirect. and i want that page to be seen in my webbrowser control.

How do i do this.
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 7
Reputation: ITSVPS is an unknown quantity at this point 
Solved Threads: 1
ITSVPS ITSVPS is offline Offline
Newbie Poster
 
0
  #2
Oct 30th, 2009
Have you tried modifying the DOM to include JavaScript for form submitting, and then doing it like that? You can invisible DIV over the entire page and onmouserover it if you can't do it from the control itself. If you have access to the DOM through the web browser control in WPF the sky's the limit. Oh, and to answer that question for you:

http://rhizohm.net/irhetoric/blog/72/default.aspx

You have control.


Originally Posted by nccsbim071 View Post
I have a php website which i want to run in C# wpf webbrowser control.

I have a validated a username and password for the site by connecting to it's database using .net.

Now i want the functionality to take username and password and submit the post form to php page that will validate the username and password again(of course it is already validated) or not validate and send the user to the page that it needs to redirect. and i want that page to be seen in my webbrowser control.

How do i do this.
ITSVPS.com Virtual Servers - Cutting edge technology, first class network, affordable prices! Managed and unmanaged. Virtual and Dedicated. Shared hosting, web design, application development, and more. Contact us here, or our website!
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 88
Reputation: nccsbim071 is an unknown quantity at this point 
Solved Threads: 6
nccsbim071's Avatar
nccsbim071 nccsbim071 is offline Offline
Junior Poster in Training

Well, guys thanks for the reply

 
0
  #3
Nov 1st, 2009
I found the solution.

Thank you
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 7
Reputation: ITSVPS is an unknown quantity at this point 
Solved Threads: 1
ITSVPS ITSVPS is offline Offline
Newbie Poster
 
0
  #4
Nov 1st, 2009
Could you share with us?
ITSVPS.com Virtual Servers - Cutting edge technology, first class network, affordable prices! Managed and unmanaged. Virtual and Dedicated. Shared hosting, web design, application development, and more. Contact us here, or our website!
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 88
Reputation: nccsbim071 is an unknown quantity at this point 
Solved Threads: 6
nccsbim071's Avatar
nccsbim071 nccsbim071 is offline Offline
Junior Poster in Training
 
0
  #5
Nov 1st, 2009
There is myWebBrowser.NavigateToString method in which we can pass the string that consist of a web form and a javascript function which submits the form when it loads, for example the code is given below:
  1. string documentText = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" +
  2. "<html xmlns=\"http://www.w3.org/1999/xhtml\">" +
  3. "<head>" +
  4. "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" +
  5. "<title>Untitled Document</title>" +
  6. "<script type=\"text/javascript\">" +
  7. "function SubmitForm()" +
  8. "{" +
  9. " document.forms[0].submit();" +
  10. "}" +
  11. "</script>" +
  12. "</head>" +
  13. "<body onload=\"SubmitForm()\">" +
  14. "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"http://www.mywebsite.com/index.php\">" +
  15. "<h1>Loading....</h1>" +
  16. "<input type=\"hidden\" id=\"txtUsername\" name=\"txtUsername\" value=\"" + txtUserName.Text + "\" />" +
  17. "<input type=\"hidden\" id=\"txtPassword\" name=\"txtPassword\" value=\"" + txtPassword.Password + "\" />" +
  18. "<input type=\"hidden\" value=\"Sign In\" />" +
  19. "</form>" +
  20. "</body>" +
  21. "</html>";
  22. myWebBrowser.NavigateToString(documentText);
My Personnel Blog:dotnetworker.blogspot.com
My Company:http://www.bizpersonnel.com
Blog:http://bizpersonnel.wordpress.com
Reply With Quote Quick reply to this message  
Reply

Tags
c#, form, php, post, webbrowser, wpf

Message:


Thread Tools Search this Thread



Tag cloud for c#, form, php, post, webbrowser, wpf
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC