Results 1 to 3 of 3

Thread: Application object isn't visible in the cshtml page

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2007
    Posts
    36

    Question Application object isn't visible in the cshtml page

    Folks,

    I'm clearly missing something, which is not surprising, because I'm new to ASP.NET.

    I'm making a session counter, which is incremented in the Session_Start() event and decremented in Session_End(). (This is just an exercise. I found it here.)

    I have created a Global.asax file and added the event handlers. So far so good.
    Then I wanted to access the Application object in a .cshtml file, but the Application object is not available. It's underlined with a red squiggly line.

    What could I be missing?

    Any suggestion, insight or reference is really appreciated!

    Cheers,
    - Nick

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,657

    Re: Application object isn't visible in the cshtml page

    Well you appear to have opened an MVC project, and to be honest if you are new to ASP.Net you might be better off starting with a standard ASP Web Forms project.

    If i where you i would open a new project and when selecting project type select ASP Web Forms,

    MVC is a particular design pattern (for which ASP.Net has its own project type) BUT the example you are following is just expecting a standard Web Forms project.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2007
    Posts
    36

    Re: Application object isn't visible in the cshtml page

    My little test project is WebPages rather than MVC. However, I want to get some familiarity with MVC soon.

    I have already looked into WebForms. It may be easier to learn, but it doesn't look to me that WebForms is the future. From what I gather, majority of new developments are MVC.

    I'm new to ASP.NET, but I'm not new to programming. I'm not afraid of learning intricate concepts. I'm working on a hobby project at my own pace.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width