Error while accessing Httpcontext.current.Session in DAL (Httpcontext doesnot exist) even after adding System.web

First of all Data Access layer is for accessing the data that is why it is named as data access layer but not the session access layer so try to use session value in an hierarchical manner from upper layer to lower layer by making it as a data

For eg.
 Session["server_id"] = "12";  /* In controller action method */
here server_id is a property stored as session now send this value from controller to BAL or your lower layer through function as  sendId(Convert.ToString(Session["server_id"])); as parameter in function and access this as a data
function sendId(string server_id)
{
    string my_server_id = server_id;
}
     

Comments

Popular posts from this blog

Npgsql query and format with output parameters

Npgsql Helper class