locked
Session object like functionality in WPF RRS feed

  • Question

  •  

    In ASP.NET 2.0 Session objects are used to store data unique to a particular client while that client is connected to a Web application.

     

    Do we have any such functionality in WPF?

     

    If yes, what is that and how to achieve that functionality?

     

    Reply ASAP.....

     

     

    Regards,

    Amit

    Thursday, May 8, 2008 12:10 PM

Answers

  • As WPF and XBAP applications may seem very ASP.NET-like they a nevertheless not related to web development. In most cases WPF executable can be easily converted/migrated to xbap application preserving functionality. I'd recommend you thinking of it as new winforms approach (WPF) running in IE rather that rendering at server side. So in this case you can introduce any suitable collection class for storing the data supposed to be used in Session as each intance of your xbap will have similar uniqueness as the web page.

    Friday, May 9, 2008 12:59 PM

All replies

  • As WPF and XBAP applications may seem very ASP.NET-like they a nevertheless not related to web development. In most cases WPF executable can be easily converted/migrated to xbap application preserving functionality. I'd recommend you thinking of it as new winforms approach (WPF) running in IE rather that rendering at server side. So in this case you can introduce any suitable collection class for storing the data supposed to be used in Session as each intance of your xbap will have similar uniqueness as the web page.

    Friday, May 9, 2008 12:59 PM
  • Session objects are necessary in a web application because of the stateless nature of the web.  They don't make any sense in a WPF application where you have state.

    Friday, May 9, 2008 6:38 PM
  •  

    XAML browser applications (XBAPs) combine features of both Web applications and rich-client applications.

     

    XBAPs can be published to a Web server and launched from Internet Explorer and can take advantage of the capabilities of WPF.  It offers web-like deployment. When a user clicks on a link, application files are downloaded and installed on the machine and the application runs in browser window.

    WPF browser application doesn't have any request/response infrastructure.

     

    Data Access:

    Data can not be accessed directly through xbap application as in windows application due partial trust security sandbox.

    It can be accessed through WCF/Web service, which can then retrieve data from a DataBase and return it.

     

    To summarize, it is not similar to pure web application as in ASP.NET.

    Saturday, May 10, 2008 6:50 AM
  • Amit, as all have explained, WPF is mostly targetting thick client applications and all data is in memory while your application is running and only 1 user uses it at any give time, so no session support is required.

     

    If you can explain what you intend to do and why you wanted a behavior like Session, maybe we can give provide more clear guidance.

     

    Sunday, May 11, 2008 5:30 AM
  • hi atul,

     

    it was just a misunderstanding...

    now the picture is clear....

     

     

     

    Sunday, May 11, 2008 9:08 AM