1

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.

user1652656
  • 53
  • 1
  • 5
  • Did you try WebBrowser Control (Windows Forms)? Have look on following link i don't know that provide you a session access [msdn](http://msdn.microsoft.com/en-us/library/2te2y1x6.aspx) – saeed Feb 13 '13 at 05:11
  • Can you explain the whole workflow from browsing, buying, opening the winform to opening aspx? who are various user? why user is using two application website and winform? – Falaque Feb 13 '13 at 06:14

2 Answers2

3

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.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Habib
  • 219,104
  • 29
  • 407
  • 436
  • but i need it as session object,and need to open port for the page i want to host, which i dont know how to do that – user1652656 Feb 13 '13 at 05:08
  • @user1652656, as far as opening a port is concerned I think it relates to network department, You can't share a session between Winform and ASP.Net site, you may setup a session in ASP.Net site based on the querystring – Habib Feb 13 '13 at 05:14
  • @Habib it's diffidently correct that you can not share a session between a webpage and a winform Windows apps (Windows hosted) and web apps (browser/server hosted) run in separate environments and execute differently. There isn't really any built-in inter-process communication you can use to pass data between the two. – saeed Feb 13 '13 at 05:28
1

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

KalG
  • 117
  • 1
  • 1
  • 10