简体   繁体   中英

Load asp.net website inside winform C#

I have a(n) (MDI) Windows Form application. It contains two forms. One form (Measured data) controls an engine, another form (laboratory) should show my asp.net web site that has various assignments for the user to do.

How can I show the asp.net default page in that laboratory form? I'm using awesomium to make a browsing window in my laboratory form.

Doing the following

webView.LoadURL("file:///D:/school/4e%20jaar/Erasmus/ErasmusProject/Laboratory/deault.aspx");

gives an error. Probably because the asp.net site isn't online. but how can I run the site so I can see the default.aspx page?

I have on solution with three projects

ErasmusProject

  • ASP.NET website
  • SIMOclasses
  • SIMOForm

The problem is you cannot execute aspx files with file:/// path. You have to execute on IIS.

So first thing you have to do setup iis if you didnt, create new web site (or use Default Web Site) to execute your aspx files, than change your link file:/// to http://localhost or something.

The URL you've specified looks like its accessing the raw file via the file system. ie file:///D:/.../default.aspx .

(You've also misspelt 'default' in your question!)

Can you access that URL from a browser (eg IE, Firefox, etc) and see the content you want? I suspect you can't and that you're missing the webserver that is compiling and serving the .aspx pages.

您应该首先托管您的网站:

WebDev.WebServer /port:9999 /path:"C:\Projects\MyWebSite"

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