Interacting with session state from InfoPath - InfoPath Dev
in

InfoPath Dev

Interacting with session state from InfoPath

Last post 01-25-2013 04:40 AM by Poolio. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-25-2013 04:40 AM

    • Poolio
    • Not Ranked
    • Joined on 01-25-2013
    • Posts 2

    Interacting with session state from InfoPath

    Hi,

    I've got a browser-enabled InfoPath 2013 form hosted in SharePoint 2013, with some code behind that interacts with the ASP.Net session state. I've enabled the SharePoint session state service (SQL Server mode) and configured the web.config to enable session state.

    At the moment the form just has a button with one line of code which executes onClick:

    HttpContext.Current.Session.Add("Foo", "1");

    This should create a session state variable called "Foo" with a value of 1 when the button is clicked.

    However the code fails with an "Object reference not set to an instance of an object" error. I put some checks into the code to see what was going on, and it transpires that HttpContext.Current.Session is coming back null.

    Does anyone have any ideas why this might be?

    Thanks

    Anthony

Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.