Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / October 2004

Tip: Looking for answers? Try searching our database.

Modify global.asax.cs

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott - 09 Oct 2004 21:31 GMT
According to a recent Microsoft article, we should do this:

void Application_BeginRequest(object source, EventArgs e) {
   if (Request.Path.IndexOf('\\') >= 0 ||
       System.IO.Path.GetFullPath(Request.PhysicalPath) !=
Request.PhysicalPath) {
       throw new HttpException(404, "not found");
   }
}

from now on in our global.asax.cs files for web apps.  I'd like to just
modify VS.NET so that it automatically does that when new projects are
created.  However, I don't see global.asax.cs as a template anywhere.  I see
global.asax, but not it's codebehind.

Is there a way to make this code automatic on all new C# web projects in
Visual Studio 2003?
Martin Kulov - 09 Oct 2004 23:02 GMT
Hi Scott,

Microsoft provided HTTP module that you only need to install once on your web site to prevent this issue. I suppose you can use the dll as a part of your project also.

HTH,
Martin Kulov

> According to a recent Microsoft article, we should do this:
>
[quoted text clipped - 12 lines]
> Is there a way to make this code automatic on all new C# web projects
> in  Visual Studio 2003?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.