简体   繁体   中英

Run aspx page from winforms

I have website and winform projects, the site is virtual book shop, there's a part when you're done "buying" and the site generates reciept as aspx page based on session["Order"] value, i would like to be able to get to the reciept page from my winform project(while i pass my id parameter) , i figured i have two options to do that:

  1. to get values from my winform project and load the recipt page with it.
  2. to run a diffrent aspx page that allows me to input id.(easier way i think)

my main issue is i couldnt realise how to run aspx page from my winform project(and open port to use for it)using webdev tool.
the second issue is i'm not sure how to use sessions in winforms(in order to pass my parameter).

I googled a lot and found myself too confused.

You can pass the ID via query string with the URL from your Winform application. In your ASP.Net site, handle that ID from query string and show the receipt page accordingly. Something like:

ProcessStartInfo processStartInfo = new ProcessStartInfo("http://example.com/yoursite?ID=2");  
Process.Start(sInfo);

The above will open the site in the default browser on the machine

As far as managing session is concerned within Winform and ASP.Net site, I don't think that is possible, since there is no Session with WinForm.

Try to Use the Web Browser control and you can host a *.aspx with it.

Use these tutorials if you can,

http://msdn.microsoft.com/en-us/library/aa752041(v=vs.85).aspx

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