Note that there are some explanatory texts on larger screens.

plurals
  1. POParser Error Message: Could not load type "ContextModule"
    primarykey
    data
    text
    <p>I have just started to learn asp.net MVC3 and i run into this problem:</p> <p><img src="https://i.stack.imgur.com/QWkz2.jpg" alt="error message"></p> <p>I'm using visual studio 2010, and there were no Errors during build, only when i try to run application. I'm searching for an answer on Google but with no success. Does anybody knows how to fix this?</p> <p>Thanks!</p> <p><strong>EDIT-ContextModule code:</strong></p> <pre><code>using System; using System.Web; namespace testbaza.Models { public class ContextModule : IHttpModule { internal const string CONTEXT_KEY = "datacontext"; public void Dispose() { } public void Init(HttpApplication context) { context.PostRequestHandlerExecute += new EventHandler(context_PostRequestHandlerExecute); context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute); } private void context_PreRequestHandlerExecute(object sender, EventArgs e) { if (HttpContext.Current.Session != null) { HttpContext.Current.Session[CONTEXT_KEY] = new EntitiesModel(); } } private void context_PostRequestHandlerExecute(object sender, EventArgs e) { CommitTransactions(); DisposeContext(); ClearSession(); } private void CommitTransactions() { if (HttpContext.Current.Session == null) { return; } EntitiesModel dbContext = HttpContext.Current.Session[CONTEXT_KEY] as EntitiesModel; if (dbContext != null) { dbContext.SaveChanges(); } } private void DisposeContext() { if (HttpContext.Current.Session == null) { return; } EntitiesModel dbContext = HttpContext.Current.Session[CONTEXT_KEY] as EntitiesModel; if (dbContext != null) { dbContext.Dispose(); } } private void ClearSession() { if (HttpContext.Current.Session == null) { HttpContext.Current.Session.Remove(CONTEXT_KEY); } } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload