简体   繁体   中英

Load ASPX page to a windows webbrowser control

嗨,我有一个Windows窗体,将数据导入到SQL中,还有一个aspx页面,用于预览需要使用WebBrowser Control加载到Windows窗体中的数据,我的问题是我如何传递集合(列表)到aspx页面以使其能够绑定到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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM