none
Web Browser Control and Windows Forms

    Question

  • Hello all and thanks for reading my question. I'm new to Windows Forms and I want to know if the following is possible.

    I have a web browser control in a windows form that will load a aspx page from the web for purposes of registration for an event. My windows form application has already collected this information during installation and it is stored in a local SqlCe .sdf file. So rather than having the user input that info again I would like to either...

    A) Prepopulate the form loaded into the web browser control with the data that is stored in the sdf file.

    B) Is there a more sensible method for acheiving what I want to do?

    At the end of the day my objective is pull 3 fields from the sdf (fname, lname, email) and to submit to a sql server via internet. Then return a confirmation code from sql server to be stored in the sdf file. I am interested in how you seasoned pros would approach this?

    Thank you so much for your thoughts!

    Bill

    Monday, March 22, 2010 3:22 AM

Answers

  • Hi Bill_gnidesign,

    If the web pages can be adjusted, it is possible. You can add a java script function which takes parameters to populate the form. Then you can call the InvokeScript method of the WebBrowser control with the fields read from the sdf file as the second parameters.

    You can get more and a sample about InvokeScript from:
    http://msdn.microsoft.com/en-us/library/4b1a88bz.aspx

    Let me know if this does not help.
    Aland Li


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    Thursday, March 25, 2010 6:17 AM
    Moderator