Solved

why global.asax missing a method ?

Posted on 2015-02-06
4
98 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
  • 3
4 Comments
 
LVL 22

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 22

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 22

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now