.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Custom 404 Error

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :SharePoint

I'm trying to create a custom 404 error page on my WSS 3.0 Sp2 web application. I’ve changed my FileNotFoundPage property for my current web application and that solved the 404 errors when I go to a URL that is not part of the _layouts folder (e.g. http://myserver/ somePageThatDNE.html). However, if I go to a page that is in the layouts folder (e.g. http://myserver/_layouts/ somePageThatDNE.html) I see the standard IE 404 error message. I created a custom HTTP module that redirects on an error. But that only works for ASPX pages not HTML. Is there a solution that will cover all avenues?



View Complete Post

More Related Resource Links

Custom Control Design-Time SiteMap Provider Error


Greetings - I was referred here by MSDN forums hope this is the right place -  

I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains

Error Creating Control - MyControl  The provider 'AspNetXmlSiteMapProvider' specified for the defaultProvider does not exist in the providers collection.

I have discovered that the error is cause by this line of code:

string div = string.Format("<div class='{0}' id='{1}'>{2}</div>", this.CssClass, this.ID.ToString(), EnumerateNodesRecursive(SiteMap.RootNode, level));

or more specifically, by the reference to SiteMap.RootNode - I am not clear what is missing thoough because I have configured the SiteMapProvider in web.config as this:

        <add name="AspNetXmlSiteMapProvider" 
             type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 

Custom Control Design view error



I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.

Error: '<SomeValue>' Could not be set to '<SomeProperty>'

This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control will render fine in Design view. It's only when I set a value to a custom property.

Property Code Example:

public string Text
                string ret = "";
                object obj = ViewState["Text"];
                if (obj != null)
                    ret = obj.ToString();
                return ret;
                ViewState["Text"] = value;

I've even removed the Category and Description tags with no difference.

I don't know if what I said makes sens, but I hope it

Error Handling: Throwing Custom Exception Types from a Managed COM+ Server Application


Exception handling semantics in .NET are based on type, so you can create custom exceptions that have their own properties and methods. In .NET, exceptions are first-class citizens, and since they're the built-in error handling mechanism, all .NET-compliant languages must support exceptions. In addition, COM+ services are available to .NET code as Enterprise Services, so you can leverage exceptions in your Enterprise Services design.In this article the author describes custom exceptions, throwing exceptions across COM interop boundaries, and working with Enterprise Services.

Bob DeRemer

MSDN Magazine March 2004

Custom tool error: Failed to generate code for the service reference 'CompanyService'. Please che


A little background because I feel I have an out of the ordinary architecture in place and don't know if this is contributing to the problem. 

We have an existing ASP.net application that is undergoing expansion.  The new functionality is all written in Silverlight 4.  As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place.  To do this I created a standard .net Class Library and added my edmx files there.  Naturally, the business entities created by this cannot be used in Silverlight.  So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files.  I changed the name space to be the same.

So I have the following assembly / namespaces

Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)

Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)

With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects.  Really it's a beautiful thing.

Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files.  These messages are things like MyObjectRequest; they are class

Rejected by custom validation error & ItemAdding



I believe this topic was discussed before in this forum, but I couldn't find it using the exact error I receive: "operation for file.doc was rejected by custom validation on the server"

When I try to add a new word document to my doc library, Word displays this error instead of my custom error message. I set properties.Cancel=true in ItemAdding of my EventHandler, because my validation fails. 

Is there any way to display user properties.ErrorMessage instead of this generic error message?


Returning custom error messages with an UserNamePasswordValidator

Ok, my head hurts from banging it against the wall. I'm new to WCF, I have searched for a solution for days, please help a desperate fellow programmer if you can :-( I have a WCF service hosted in IIS, I implemented a UserNamePasswordValidator, and it seems impossible to find a way to return a custom error message to the client when the user is not allowed in, this blows my mind. I have searched everywhere, many are asking the same question since 2006 and so far I haven't found an answer that works. If you are thinking of replying that it is not secure to return a custom error message to an unauthenticated client, please save yourself some time and don't do it. There are multiple enterprise business scenarios that this is required. Just in our organization an account could be locked out, in which case the user must be directed to the IT department to get it unlocked, it could be that the credentials are correct but the user hasn't paid their fees in which case they must be directed to the appropriate department, or it could even be that the user tried to access the service during a time of the day in which the service is not available. From searching around, I have tried doing the things below in the Validate method, however the client always receives a MessageSecurityException, which contains none of the custom messages that were originally thrown, neither in the object,

Cannot delete custom column in calendar list - 'unknown error'

I've created a column in a calendar list and now cannot delete it.  I've cleared all data and I still get the "Unknown Error" message when I try to delete. jan

WCF REST and Custom Error Handler

I have a RESTful WCF service, and I am trying to roll a custom behavior that extends the WebHttpBehavior, to provide my service a custom error handler (by implementing IErrorHandler of course). When I debug my service, the only breakpoint I hit is the getter on the BehaviorExtensionElement's BehaviorType property. None of the other methods are ever invoked; BehaviorExtensionElement.CreateBehavior(), WebHttpBehavior.AddServerErrorHandlers(), as well as nothing in my implementation of IErrorHandler. This leads me to believe that something isn't being registered with WCF. My service is defined in the app.config. When I step-through a call to one of my service's operations, I would expect that the process of throwing an exception would force my service to transfer the work to my error handler. But this is not the case... My service stops and throws me an unhandled exception, and nothing is sent to the client as a result. Am I doing something wrong? Am I not understanding this process? If someone could help me out it would be greatly appreciated!My code basically has implementations of IErrorHandler, and classes that derive WebHttpBehavior with an override on AddServerErrorHandlers(), and also BehaviorExtensionElement with an override for the property BehaviorType and method CreateBehavior(). Nothing fancy, but I have a feeling I may be missing something...This is my app.config:&

Custom WCF Service (svc) gives address scheme error

Hi, I'm reading a book by Sahil Malik on building solutions for SharePoint 2010 (from Apress). One of the items explained is how to create a custom WCF service that can then be consumed in different scenarios (.NET app, silverlight, javascript). I followed the steps as given in the book, but when I try to open the URL to the service, I get this error: This collection already contains an address with scheme http.  There can be at most one address per scheme in this collection. Parameter name: item I have to mention that when I added the mapped ISAPI folder to my VS project, it didn't create the project subfolder automatically and I accidently created my files (svc and web.config) on the root level of the ISAPI folder. I created the subfolder manually and moved these two files in the subfolder, but it doesn't seem to work. Maybe I overwrote something on the root of ISAPI ? My web.config contains this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <bindings> <basicHttpBinding> <binding name="customBasicHttpBinding"> <security mode="TransportCredentialOnly"> <transport clientCredentialType="Ntlm" /> </security&g

Pass exception details to custom error page.

Hi All, I created a custom error page and update using webApp.UpdateMappedPage(SPWebApplication.SPCustomPage.Error, CustomErrorPage). Its working fine and my custom error page is show if error is occurred. OR We redirect using SPUtility.RedirectToErrorPage("my message"); But I am not able to find my exception details at my custom error page. Is there any way to pass the exception details and other custom information to custom error page?  

custom 401/login failure error messages

I have a req to display a custom error message when a user fails to log in 3 times.  The default behavior seem to be for a redirect to something like this http://server/_layouts/AccessDenied.aspx?loginasanotheruser=true&Source=http%3A%2F%2Fserver2k7%2FPages%2FDefault%2Easpx after the third login attempt.  The resulting page just comes up as blank...I'm guessing because it failed auth.  My initial thoughts were to create a custom error page, and redirect with an http module.  That solution (while it does redirect) puts me right back to the initial problem of just a blank page being displayed after the failed auth.  I've been struggling with this for a while now, ANY thoughts or advice would be greaty appreciated.  Is it even possible? 

Custom error page

Hi all,I'm having VS 2008 professional. I want to generate a custom error page in my website. I added simple .htm file and wrote in it whatever i wanted it to display. Then I went to ASP.net configuration > Application > Define default error page and then selected my .htm file & saved it. After that if i tried to view my website in browser, it is not showing me the error page which i created instead it is showing the server error page which VS generally shows if there is some error in the code. Plz help to sort outSmitha

What is the correct error handling in custom model binding?

Hello,I am working on a Custom Model Binder where a certain error can occur.When this happens it returns null and a error is added to the ModelState.The problem is that in some projects I am using Fluent Validation and the errors messages I am adding through FV are not taking effect.The message added by the Model Binder always prevails.Should the Model Binder add error messages or just bind the field and return null if some problem happened?What would be the correct implementation for this?Thanks,Miguel

Error deleting an item from Custom List in 2010

I have an issue that I can't figure out, concerning deleting an item from a custom list in SharePoint 2010. If I create a custom list and add a few items, and I attempt to delete one of these items by selecting the checkbox to the left and using the "Delete Item" command on the Ribbon, I get this error (in IE):Object Expectedinplview.jsCode:0Line:2Char:20804URI: <a long nondescriptive URI>Interestingly enough, if I attempt to delete the same item by viewing it and selecting "Delete Item" (in the dialog box), it works that way. It seems like I can't delete items using the command in the Ribbon. This is also true for deleting library document items.Any ideas on how to solve this? I can't seem to find out what this inplview.js file is used for, and it doesn't exist on the server PC (I did a file search for it, and came up empty).Thanks,John

Invoking custom WCF service throws an Impersonation error from SQL

I've written a custom WCF service and hosted it in SharePoint. Accessing the MEX endpoint works fine. However, when I try to invoke the WCF service from my client code, I get the following error: 'A transport-level error has occurred when sending the request to the server. (provider: Shared Memory Provider, error: 0 - Either a required impersonation level was not provided, or the provided impersonation level is invalid.)'. This exception gets thrown even before my WCF service gets invoked. Attaching a debugger, I see the following stack trace associated with the exception: 00000000`0c2dd7d0 000007fe`e7589b95 System_Data_ni!System.Data.SqlClient.SqlConnection.OnError(System.Data.SqlClient.SqlException, Boolean)+0xd4 00000000`0c2dd810 000007fe`e7b7cd3b System_Data_ni!System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(System.Data.SqlClient.TdsParserStateObject)+0xf5 00000000`0c2dd870 000007fe`e758c4ee System_Data_ni!System.Data.SqlClient.TdsParserStateObject.WriteSni()+0x5f77ab 00000000`0c2dd8f0 000007fe`e758bf29 System_Data_ni!System.Data.SqlClient.TdsParserStateObject.ExecuteFlush()+0xae 00000000`0c2dd950 000007fe`e757a1c7 System_Data_ni!System.Data.SqlClient.TdsParser.TdsExecuteRPC(System.Data.SqlClient._SqlRPC[], Int32, Boolean, System.Data.Sql.SqlNotificationRequest, System.Data.SqlClient.TdsParserStateObject, Boolean)+0x1189 00000000`0c2ddbf

Unable to Customize Custom Lists. Sharepoint Error: User cannot be found.

I am not sure what the best way to put/describe my issue . I am unable to customize my custom list. Steps: 1. Login to sharepoint site. 2. Site Actions -> Site Settings 3. Under Site Administration -> Site Libraries and lists 4. Clicked on a custom list.   Error: Error User cannot be found.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 4063bf58-9cb7-4204-8cc4-cc2889abffe3 Date and Time: 9/9/2010 5:51:58 PM   I figured this may be an issue with site permissions, so I have went into site permissions and removed and re-added Administrator into Homeowners group.   Thank you in advance.   Howie

Null reference message Custom Error page

how come a Null session value that is called, doesn't get directed to the Custom Error Page?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend