473,657 Members | 2,474 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

If no ASPNET user account, can I use Global.asax for application-level error trapping?

Using Visual Studio 2005, SQL Server 2000, and ASP.NET/VB.NET for a Web
Application.

We have a System DSN using Windows NT authentication defined on the
development box to connect to the SQL Server (both SQL and IIS are on
the 192.168.1.2 server).

We have "Identity Impersonate=tru e", and "CustomErro rs mode=On" and
"defaultRedirec t="ErrorHandler .aspx" in web.config.

(Note: We are NOT using userName = "DOMAIN\use r" password="passw ord" in
"Identity Impersonate" section. We tried it and it didn't seem to make
a difference.)

The Problem: it ONLY works from the "Developmen t Box" via the IDE.
If I hit the server (192.168.1.2) from the development box
(192.168.1.3) directly through
Internet Explorer, it will fail with the following error:

"Error [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]
Login failed for user '<machine-name>\ASPNET'"

Adding the ASPNET user account back into SQL Server on the Test Server
"fixes" the problem. However, for security reasons, we are not allowed
to have this account on the production server.

Removing the "Global.asa x" file and republishing the web site "fixes"
the problem. But then we have no error handling other than a generic
redirect page (i.e., no ability to log/e-mail the errors).

There are other options for application-level error handling, but this
seemed to be the most straightforward . Can anyone offer any help with
this problem? Thanks.

(P.S. Sorry for the duplication. My old thread had a slightly dif't
subject line and I thought that this described the problem more
accurately and succinctly)

Jun 29 '06 #1
3 2320
See a few comments inline.

"Doug" <sp*******@gmai l.com> wrote in message
news:11******** **************@ y41g2000cwy.goo glegroups.com.. .
Using Visual Studio 2005, SQL Server 2000, and ASP.NET/VB.NET for a Web
Application.

We have a System DSN using Windows NT authentication defined on the
development box to connect to the SQL Server (both SQL and IIS are on
the 192.168.1.2 server).
Why use ODBC DSN? Since you use SQL Server, you should use SQL Server native
provider and take advantage of System.Data.Sql Client namespace. Any specific
reason forces you to use ODBC?

We have "Identity Impersonate=tru e", and "CustomErro rs mode=On" and
"defaultRedirec t="ErrorHandler .aspx" in web.config.

(Note: We are NOT using userName = "DOMAIN\use r" password="passw ord" in
"Identity Impersonate" section. We tried it and it didn't seem to make
a difference.)

The Problem: it ONLY works from the "Developmen t Box" via the IDE.
If I hit the server (192.168.1.2) from the development box
(192.168.1.3) directly through
Internet Explorer, it will fail with the following error:

"Error [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]
Login failed for user '<machine-name>\ASPNET'"
Since the IIS/Web app is on the other machine, of course SQL Server will not
recognize the user account "Machine\ASPNET ". Obviously, the SQL Server uses
Windows security. If the QL Server has a login mapped to a domain
useraccount, then you can impesonate the Web app to run under that domain
user account. Or you can enable the SQL Server's mixed security mode, so
that you can pass username/password pair as SQL Server login.

Adding the ASPNET user account back into SQL Server on the Test Server
"fixes" the problem. However, for security reasons, we are not allowed
to have this account on the production server.

Removing the "Global.asa x" file and republishing the web site "fixes"
the problem. But then we have no error handling other than a generic
redirect page (i.e., no ability to log/e-mail the errors).
Why this SQL Server access has something to do with Global.asax? Do you
actually open Connection inside Global.asax or build ConnectionStrin g in it?
I am confused.

There are other options for application-level error handling, but this
seemed to be the most straightforward . Can anyone offer any help with
this problem? Thanks.

(P.S. Sorry for the duplication. My old thread had a slightly dif't
subject line and I thought that this described the problem more
accurately and succinctly)

Jun 29 '06 #2

"Doug" <sp*******@gmai l.com> wrote in message
news:11******** **************@ y41g2000cwy.goo glegroups.com.. .
Hi,

In your IIS property settings for the virtual directory, if you click the
Directory Security Tab and Edit the Authentication settings, is Enable
Anonymous Access access "unchecked" and Integrated Windows Auth "checked" ??

Doing this should impersonate your user correctly.

Using Visual Studio 2005, SQL Server 2000, and ASP.NET/VB.NET for a Web
Application.

We have a System DSN using Windows NT authentication defined on the
development box to connect to the SQL Server (both SQL and IIS are on
the 192.168.1.2 server).

We have "Identity Impersonate=tru e", and "CustomErro rs mode=On" and
"defaultRedirec t="ErrorHandler .aspx" in web.config.

(Note: We are NOT using userName = "DOMAIN\use r" password="passw ord" in
"Identity Impersonate" section. We tried it and it didn't seem to make
a difference.)

The Problem: it ONLY works from the "Developmen t Box" via the IDE.
If I hit the server (192.168.1.2) from the development box
(192.168.1.3) directly through
Internet Explorer, it will fail with the following error:

"Error [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]
Login failed for user '<machine-name>\ASPNET'"

Adding the ASPNET user account back into SQL Server on the Test Server
"fixes" the problem. However, for security reasons, we are not allowed
to have this account on the production server.

Removing the "Global.asa x" file and republishing the web site "fixes"
the problem. But then we have no error handling other than a generic
redirect page (i.e., no ability to log/e-mail the errors).

There are other options for application-level error handling, but this
seemed to be the most straightforward . Can anyone offer any help with
this problem? Thanks.

(P.S. Sorry for the duplication. My old thread had a slightly dif't
subject line and I thought that this described the problem more
accurately and succinctly)

Jun 29 '06 #3

tdavisjr wrote:
"Doug" <sp*******@gmai l.com> wrote in message
news:11******** **************@ y41g2000cwy.goo glegroups.com.. .
Hi,

In your IIS property settings for the virtual directory, if you click the
Directory Security Tab and Edit the Authentication settings, is Enable
Anonymous Access access "unchecked" and Integrated Windows Auth "checked" ??

Doing this should impersonate your user correctly.


Tried that. Still didn't work.

Jun 30 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3286
by: Matt Calhoon | last post by:
Hi there, I have specified a aspnet user account to run all .net sites. This account needs access to start a .BAT File (in my global.asax on session start the app needs to execute this bat file). I have given the aspnet user Read and execute but the .bat will still not start. What specific permissions does this user need for other folders to start a ..bat file? Does the user need access to the WINNT\System32 directory or the...
5
10398
by: Victor Jones | last post by:
I had a question about accessing HttpContext.User in global.asax. I was trying to access HttpContext.User in Application_BeginRequest() which had a null value as opposed to containing a valid GenericPrincipal while accessing it from a Page_Init() method of the same application. When does the HttpContext.User get initialized in the life-cycle? Why cannot I access the same in Application_BeginRequest() ? Thanks Viktor
22
3767
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to manipulate them. It starts > and ends with <script></script> tags. > > Yours looks like a compiled version of it.
3
2775
by: John Dalberg | last post by:
I am setting the HttpContext.Current.User in the Application_AuthenticateRequest event in global.asax.cs. When I use the IsInRole function in a web page, it works fine. So far so good. (Note that Integrated security is used and anonymous is turned off.) This app will actually work as a child app for an Intranet app so when I remove the application designation in IIS for the child app folder, IsInRole is always null, which is not good. I...
12
3811
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it (the oleDBConnection on global.asa.vb) at the other aspx pages ?
5
15095
by: ad | last post by:
The Global.asax is code-inside with default. How to change Global.asax to code-behind?
6
2143
by: Mark Rae | last post by:
Hi, When you create a new web site in VS.NET 2005, it doesn't contain a Global.asax file by default and, when you add one manually, it creates a Global.asax file with in-line code e.g. <%@ Application Language="C#" %> <script runat="server">
11
8354
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the generated code on a W2K3 server the application_start and any other event on the global.asax file won't fire. I added tracing and logging to make sure and I can see the code is just not execution. When running the same exact (deployed etc.) code on...
7
1909
by: torus | last post by:
Is the aspnet account called "aspnet" for all non-English versions of Windows and IIS?
15
2556
by: =?Utf-8?B?UGF0Qg==?= | last post by:
Just starting to move to ASP.NET 2.0 and having trouble with the Global.asax code file. In 1.1 I could have a code behind file for the global.asax file. This allow for shared variables of the Global class. Note: I use these shared variables for read only values that are set at application start. It would appear the 2.0 doesn't like you to use shared variables in the global class. How do I convert my 1.1 applications to 2.0 without...
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.