Solved

Unable to Serialize Session State

Posted on 2013-12-10
5
284 Views
Last Modified: 2013-12-17
Created asp.net program on VS2012 desktop development system and it works fine.

When I move the program to our web server I get the error "Unable to Serialize Session State" when I run program.

I have two or three string session variables and one arraylist stored in session variable.
The array list data is a struct consisting of three strings.

Program has only one aspx form with vbcodebehind.

What do I need to do to make this work outside of vs2012  (Framework 2.0)

any help with vb examples would be appreciated.

Lee
0
Comment
Question by:trims30
  • 4
5 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39710608
Check the Sessiona state setting on web server in config files . may be it is disabled.
Compare it with you local machine
0
 

Author Comment

by:trims30
ID: 39711123
I don't have any control of the server - it's a shared server I subscribe to.
Any other suggestions?
0
 

Author Comment

by:trims30
ID: 39711252
Code that causes error can be demonstrated by two subroutines below.
btnTA_Click saves an arraylist to session with no error
btnTS_Click saves an arraylist (Structure) to session and causes error.

Public Class _Default
    Inherits System.Web.UI.Page
    Structure HoursData
        Dim Project As String
        Dim Activity As String
        Dim Hours As String
    End Structure

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnTA_Click(sender As Object, e As EventArgs) Handles btnTA.Click
        Dim PinNumbers As New ArrayList
        PinNumbers.Add("1")
        PinNumbers.Add("2")
        PinNumbers.Add("3")
        Session("Pin") = PinNumbers  'THIS ARRAY IS SUCCESSFULLY SAVED TO SESSION
    End Sub

    Protected Sub btnTS_Click(sender As Object, e As EventArgs) Handles btnTS.Click
        Dim Dailywork As HoursData
        Dim Activities As New ArrayList
        Dailywork.Project = "Proj"
        Dailywork.Activity = "Act"
        Dailywork.Hours = "Hrs"
        Activities.Add(Dailywork)
        Session("Acts") = Activities 'THIS ARRAY CAUSES SERIALIZE ERROR WHEN SAVED TO SESSION
    End Sub
End Class

Open in new window

0
 

Accepted Solution

by:
trims30 earned 0 total points
ID: 39715368
had to rewrite and eliminated structures in arraylist.
All working OK now.
0
 

Author Closing Comment

by:trims30
ID: 39723500
cannot do anything to configure server since it's shared server
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question