System.NullReferenceException: Object reference not set to an instance of an object
1 comments Posted by Larry Bargers at 6:25 PM
HTTP 500 error message displays instead of ASP error message from 500-100.asp
0 comments Posted by Larry Bargers at 5:39 PMWhen a .asp file encounters an error, the following standard HTTP 500 error message is displayed instead of an error returned by the 500-100.asp file:
There is a problem with the page you are trying to reach and it cannot be displayed.
...
HTTP 500 - Internal server error
Internet Explorer
Note This behavior is described in the Internet Information Services (IIS) product documentation at http://localhost/iishelp/iis/htm/core/iiprstop.htm.
Note The 500-100.asp file should not be implemented on production Web sites. The 500-100.asp file may expose custom code to users.
To use the 500-100.asp file for error handling on the nondefault Web site, perform the following steps:
- Start the Internet Service Manager (ISM), which loads the Internet Information Services snap-in for the Microsoft Management Console (MMC).
- Right-click the appropriate Web site, click New, and then click Virtual Directory.
- In the Virtual Directory Creation Wizard, click Next. In the Alias text box, typeIISHelp, and then click Next.
- When you are prompted for the path to the content directory, click Browse, select the WINNT\Help\IisHelp folder, and then click Next.
- On the Access Permissions page, accept all the defaults, click Next, and then clickFinish.
- Right-click the Web site again, and then click Properties.
- On the Custom Errors tab, select the 500;100 error line, and then click Edit Properties.
- In the Message Type list box, select URL, and then type /iisHelp/common/500-100.asp in the URL text box.
- Click OK twice to return to the ISM.
Labels: asp.net, DotNetNuke
An "Object reference not set to an instance of an object" error occurs when you try to access data by using ADO Interop on an ASP.NET page
0 comments Posted by Larry Bargers at 5:18 PMOn a computer that has Microsoft .NET Framework 1.0 installed (and that does not have Microsoft Visual Studio .NET installed), when you try to access data using ADO Interop on an ASP.NET page that resides at an identical site and that is hosted on the same computer, you may receive the following error message:
To register Adodb.dll in the GAC, follow these steps:
- Click Start and then click Run.
- In the Run dialog box, type the following command, and then click OK:C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\gacutil /i C:\Program Files\Microsoft.NET\Primary Interop Assemblies\adodb.dll
Labels: asp.net
ASP.NET Webservices: "The request failed with HTTP status 401: Access Denied." Error
0 comments Posted by Larry Bargers at 12:25 PMYou may receive the error "The request failed with HTTP status 401: Access Denied." when trying to access a Webservice from your ASP.NET Application.
This normally indicates that Anonymous access has been disabled for the Webservice.
You can resolve this issue by either of the following ways:
1. Enabling Anonymous Access in the IIS Directory Security
To do this, the following steps will help you.
1. Click "Start" - "Run" - Type "inetmgr" and press "Ok" or "Enter" Key
2. IIS Control panel opens.
3. Expand the appropriate nodes and navigate to the virtual directory of your Web Service Application.
4. Select the Virtual directory, Right Click and select "Properties"
5. Switch to the "Directory Security" Tab and then Click "Edit".
6. Check the "Anonymous Access" CheckBox.
7. Click "Ok" twice to exit.
This should solve your problem. Happy Coding my friends!
Labels: asp 2.0, asp.net, Web Services
ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class
16 comments Posted by Larry Bargers at 8:49 AMIn asp.net simply changing the attribute "codefile" to "codebehind" should do the trick.
Change:
Control language = "VB" Inherits="Bold.Modules.SupportCase.ViewSupportCases" Codefile="ViewSupportCases.ascx.vb" AutoEventWireup="false" Explicit="True"
To:
Control language = "VB" Inherits="Bold.Modules.SupportCase.ViewSupportCases" Codebehind="ViewSupportCases.ascx.vb" AutoEventWireup="false" Explicit="True"
CodeBehind
Specifies the name of the compiled file that contains the class associated with the page. This attribute is not used at run time.
This attribute is included for compatibility with previous versions of ASP.NET, to implement the code-behind feature. In ASP.NET version 2.0, you should instead use the CodeFile attribute to specify the name of the source file, along with the Inherits attribute to specify the fully qualified name of the class.
CodeFile
Specifies a path to the referenced code-behind file for the page. This attribute is used together with the Inherits attribute to associate a code-behind source file with a Web page. The attribute is valid only for compiled pages.
Labels: asp.net, aspx, DotNetNuke, vb.net