Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

why global.asax missing a method ?

Posted on 2015-02-06
4
Medium Priority
?
121 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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

604 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