Load ASPX page to a windows webbrowser control
Hi I have a Windows form the import data to SQL, also I h开发者_如何学Pythonave an aspx page which is used for previewing data which i need to load to to the windows form using WebBrowser Control, my problem is that How do I pass a collection (List) to the aspx page for it to be able to bind to a gridview?
You can't - they are separate things.
The WebBrowser control simply renders an IE window on your form, loading the requested page and rendering it as usual.
If you want to pass data to the webpage from the web application, you will need to get the data to whichever data source (ie: common database etc) the web app reads from then refresh the web page which will read the new data.
Look at ASP.NET application hosting.
There are a couple of examples already written, so you do not have to re-invent all the glue.
Here is the code I used for IronScheme's 'document browser'.
Here you can see how I setup the server part in a simple console app, but creating a windows forms one is not hard.
As for passing data, you can simply just dump it in the ASP.NET application state, and then read that back from within your ASPX page.
精彩评论