Solved

why global.asax missing a method ?

Posted on 2015-02-06
4
112 Views
Last Modified: 2015-02-13
I am using ASP.NET MVC. But  I am missing  methods  RegisterRoutes and registerGlobalFilters  in global.asax.

I contains only the following method. Why ? Should I have to add those method manually ?

// Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
        }
    }

Open in new window

0
Comment
Question by:Varshini S
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 23

Expert Comment

by:Snarf0001
ID: 40593491
Don't recall what version of MVC it was (3 maybe), but those methods were moved by default into their own classes in App_Start.  They should be in there.
0
 
LVL 23

Expert Comment

by:Snarf0001
ID: 40593496
Should note as well, doesn't really matter.  If you're more comfortable having them in there, move them back, the default templates just started putting them in their own classes and in a different folder.
0
 

Author Comment

by:Varshini S
ID: 40593698
Snarf0001: You are correct. It is MVC 3. It is in App_start folder. But I did not get you  about move them back to own classes. How ?
0
 
LVL 23

Accepted Solution

by:
Snarf0001 earned 500 total points
ID: 40594239
Well, if you wanted to, you could just move the individual functions RegisterRoutes, RegisterBundles etc out of their individual classes and back into global.asax and call them directly.

But would be work for no real, point, they're better structured and encapsulated in the app_start.
I would just use them from there.
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question