asp.net mvc - Sharing session between MVC controller and WebApi controller -



asp.net mvc - Sharing session between MVC controller and WebApi controller -

i have web service has mvc controller , wepapi 2 controller.

the job of mvc controller render , homecoming html partial view. different mvc application makes phone call , embeds resulting html own page.

the partial view contains controls create calls webapi controller temporarily store data. purpose enabled session in webapi controller using code in global.asax.cs:

protected void application_postauthorizerequest() { httpcontext.current.setsessionstatebehavior( system.web.sessionstate.sessionstatebehavior.required); }

when calling application makes phone call mvc controller, passes model it. model contains initial info controls on partial view need display. same kind of info controls create/update/delete using webapi controller. want set info model session controls in partial view able read/update/delete data.

my question this: there way give mvc controller access wepapi session? or there way create webapi controller utilize same session mvc controller uses?

asp.net-mvc session asp.net-mvc-5

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -