0

I can tried save some data to ViewState, but i get this Error: Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'HeRMeSSAAS.BussinesProcess.BussinesServices.CandidateService' of type 'HeRMeSSAAS.BussinesProcess.BussinesServices.CandidateService.' Code:

private IActionService ActionService
    {
        get
        {
            return ViewState["ActionService"] as IActionService;
        }
        set
        {
            ViewState["ActionService"] = value;
        }
    }

private void InitializeField(IActionService service)
        {
            ActionService = service;
        }

How i can store value to ViewState?

2 Answers 2

4

s your HeRMeSSAAS.BussinesProcess.BussinesServices.CandidateService decorated with the Serializable attribute?

eg:

[Serializable]
public class CandidateService
{

}

if this is not a very simple class I would also recommend storing it in the Session rather than the ViewState as it will take longer for the page to download and render

Sign up to request clarification or add additional context in comments.

Comments

1

you need the [Serializable] Attribute on top of your business object.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.