0

I am trying to pass the session from mvc controller to asp page

public ActionResult RedretToMyAspPage()
{
    var result = MySerive.GetData(stuData);
     Session["stuDataCode"] = stuData;
    if (result.Result)
    {
        Response.Redirect(result.redirectToURL);
    }
    return View();
}

and on asp page am getting session by

dim studata
dim len
len = Len( Session( "stuDataCode" ))
studata = Session( "stuDataCode" )

but here I am getting len = 0

3
  • 1
    Are dim and Len exist in C#? This doesn't look like C# code. Commented May 5, 2017 at 9:42
  • 1
    @mmushtaq, nope .. that's legacy VB code Commented May 5, 2017 at 9:44
  • that is the problem i have to pass session from mvc to asp page Commented May 5, 2017 at 9:49

1 Answer 1

1

No, you can't access the session this way cause both your application (MVC and ASP.NET) probably running on different application pool with different w3wp worker process. Thus the session won't be available. One solution is to use pooled session (or) use client side mechanism cookie (or) pass it to the URL as a query string parameter, e.g. localhost:1234/foo?stuDataCode=1234

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

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.