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


Top 5 Contributors of the Month
david stephan
Post New Web Links

creating custom error page

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net
 

Hi ..

I have two errors in my application i want to display a custom  defferent error page for each error...

Here is my code

protected void Button1_Click(object sender, EventArgs e)
    {
      
            int a = 10;
            int b = 0;
            int c = a / b;
     
      // FIRST ERROR
   

    }
    protected void Button2_Click(object sender, EventArgs e)
    {
       
       

            string str = "hjdfgjh";
            int vv = Convert.ToInt32(str);
       
        //SECOND ERROR
       
         
    }


i have configured web.config like b


View Complete Post


More Related Resource Links

The page cannot be displayed error when creating new item in custom list

  

Hi i am workign with a cutom list and every time i try to add a new item and hit ok i get the error shown below. Sometimes it happens and other times it doesnt and it only happens with a select few. One way of getting around this error is to not edit it on the page on which it is on but to go to view all content then to the custom list.

I have tried observing whether there was an issue with the pages being checked in and checked out but all pages were checked in and published. I tried deleting and recreating the custom list and no luck. Your feedback would be much appreciated! Thanks in advanced

btw i am a user with full control and our site is being hosted.

The page cannot be displayed

 

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?  

Help with creating graphs in a site page from figurative data in custom list

  
Guys Can anyone provide me with someone help please? I need to be able show a graphs/line format in a web part of a site page on my SP 2010 site. I want to use some changing figurative data that is contained within a custom list change a the line/pie chart graph on the fly that is located within a chart/line graph in a site page. Basically when the data in the custom list gets changed by my resources I want to be able to see the changes in the graph almost like a live dashboard. I would be very greatful for some help. Note: I am not a coder nore do I ever claim to be, but if I could get a step by step guide on how to achieve this then I would be very greatful. I have a good understanding of SP but I am not to the coder. I able to supply the list if necessary and if someone could provide me with the code/or if code is not necessary for this task then please can you advise how? Many Thanks Mike Gowlett PMP P2P (MCSE, MSP, Old School :-) 

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

Null reference message Custom Error page

  
how come a Null session value that is called, doesn't get directed to the Custom Error Page?

Creating custom property on derived Page

  
I am attempting to accomplish the following during the creation of a Page derived from DerivedPage: <local:DerivedPage xmlns="..." xmlns:x="..." xmlns:local="..." MyProperty="My Value" Title="My Title"> ... </local:DerivedPage> You'll notice an extra property MyProperty in there. The code-behind is like this: class DerivedPage : Page { public string MyProperty { get; set; } ... } When I execute this, I get a null reference in InitializeComponent() when I create a Page derived from DerivedPage. I also tried making MyProperty a dependency property.  But I get the same results. How can I create a property for my new base-class that's set in the markup of my derived class. Thanks, ...Matt

Duplicate field name error, creating new site from custom template

  
I've made a site that maps the site (with a table of contents) and i export it to another site collection. I'm able to install and activate the solution in the other site collection, however when i'm going to create a new site using the site i've installed as a template it pops an error saying "A duplicate field name Wiki_x0020_Page_x0020_CategoriesTaxHTField" was found." I have no clue what this means. Can anyone help me? Thanks in advance

"403 forbidden" Error in my Custom login page

  
Hi All,   I Created a custom login page using Sharepoint Application page which is cofigured with FBA using this article http://blogs.msdn.com/b/kaevans/archive/2010/07/09/creating-a-custom-login-page-for-sharepoint-2010.aspx. But I keep getting the "403 forbidden" error. Can anyone suggest me a solution. Thank you.

Error creating a normal Custom List

  

I am using the normal sharepoint screans to create a custom list. When I click create it falls over with

'w3wp.exe (0X2254) 0X2C80 CMS Publishing 8Ztg Medium Got list item version, but item was null. ' on the log files.

This is a publishing template site with no VS custom list definitions.
This is just a normal site.

What can i do to rectify this.


Displaying custom error page

  

For certain parts of the site the allow inserting and updating of data we have some try / catch logic in place..

Now we would like to display a custom error page explaining what didnt happen. Instead of just a generic message that says error occurred.

Here is 1 error that is generated due to Primary Key constraints, we woudl like to redirect them to our error.aspx page which is already setup and configured in the web.config but within that page display a more user friendly detail message of why they got the error. In the example below, we may want to say, "There was an error with the "Access Insert" please make sure that the values you entered on the previous page are unique" thats just an example, but gives an idea of what we are trying to do.

thanks

 

Server Error in '/' Application.
--------------------------------------------------------------------------------

Access Point Insert Error:Violation of PRIMARY KEY constraint 'PK_AccessInfo'. Cannot insert duplicate key in object 'dbo.AccessInfo'.
The statement has been terminated. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Exce

Error when creating a custom site template

  

Hi

In VS 2010, I created a new SP project to create a custom site template.

W/O modifying the content, except setting the output path of the webtemp file to another language, I have the following error when I try to create a site based on this template :

 

failed to instantiate file "default.master" from module "defaultmasterpage": source path "default.master" not found

 

I've taken a look at OOB site templates, and I don't see what is missing.

I'd appreciate any help.

 

Steve

 

FYI, here is the content of my onet.xml  file :

 

<?
xml
 version
=
"
1.0
"
 encoding
=
"
utf-8
"
?>

<
Project
 Title
=

"403 forbidden" Error in my Custom login page, cant find problem

  
I Created a custom login page using Sharepoint Application page which is cofigured with FBA.  but every time redirect to http://testsp.max-perf.com/_layouts/DataQ.Extranet/test.aspx?ReturnUrl=%2f_layouts%2fAuthenticate.aspx%3fSource%3d%252F&Source=%2F .  I have  Win2008 (not r2) and sp2010. Thank you.

steps for creating a custom master page in SharePoint 2010

  

Hi

Can any one please help me out to prepare a custom master page in SharePoint 2010 designer and deploy it to SharePoint site.

i have a html page , which i want to put in my custom master page.

please help

 


Need help with a custom error page that shows the error message details

  

I know how to alter the web config to redirect to an errors page but what I need to do is have the actual offending error message print to that page. This is a special request for testing reasons, I realize the whole point of a custom error page is to provide a user friendly message when an error occurs but for testing we want to show the user the message so they can copy and paste it into a ticketing system we are using for beta testing feedback.

Should I use the global.asax instead? I am pretty new to vb.net and am not sure how to get the actual error message to display on my custom error page. Any guidance would be greatly appreciated.

Thanks



Custom Error Page question

  

I create my own customize error page. The code fragement for catch the eroor as following:

HttpCompileException _ccExp = null;
string _expType = "RunTime Error...";
Exception _lastError = Server.GetLastError();

// Get the Stack Frame
if (_lastError is HttpUnhandledException && _lastError.InnerException != null) _lastError = _lastError.InnerException;
//StackTrace stack = new StackTrace(_lastError.GetBaseException(), true);
StackTrace stack = new StackTrace(_lastError, true);
for (int i = 0; i < stack.FrameCount; i++)
	if (!String.IsNullOrEmpty(stack.GetFrame(i).GetFileName())) {
		_frame = stack.GetFrame(i);
		break;
	}
if (_frame == null) _frame = stack.GetFrame(0);

// Get file name
string _fileName = _frame.GetFileName();

I try get the .aspx file in the last line, "string _fileName = _frame.GetFileName();".
Why I got a url-formed file name such as "http://server/Work/SomeOne.aspx", sometimes,
and other time, I got a physical path such as "D:\websites\MySite\wwwroot\Work\SomeOne.aspx" ?

 


Error " http 404 not found" in while creating FBA enabled Claims based Authen.Web Appln with custom

  

Hi,

 

1)While creating a claims based autheitcation web appln in sps 2010, i have given a  custom login page [say mylogin.aspx] instead of default sign  in page. i gave custom membership provider name, role provider name say CMP1 & CRP1 respectively. there is no sql db for storing user profiles. we have to call a web service to authenticate. and want to know how this can be achieved using claims based authen. with the emntioned custom membership provider

2) When created a sitecollection and tried to navigate i got the error  "http 404  not found --> "web page cannot be found". i am unable to view the home page of this web appln    http://servername:5555/ and       its sitecollection url   http://servername:5555/sites/test. Where should I add the custom login page. is that login page doesnt exist in the 14\template\_layouts dierctory, it shows  http not found error if i use custom membership provider for fba with a  custom login page, what are the steps to make this web appln with the custom login page as the landing page.

any help is appreciated.

 

 

 


PrasadWT PrasadWT

404 Page Not Found Error When Trying to Create a Site From a Custom Site Template

  

I just moved a site collection from a one server to another, and now I can't make copies of my sites using custom site templates.

The details of my site structure are in the next paragraph, in case they are relevant.
On the original server, I created custom templates for my sites, and checked the Include Content checkbox
when creating the templates. Everything works perfectly on that server. When I moved the whole site collection to another
server using stsadm backup/restore everything was there, including my customized web parts. But now I can't create new sites
from templates - and I'm I'm not trying to use templates created on the original server. I'm creating new templates on the new
server. It successfully creates the templates, but when I try to create a new site from one of those templates, I get a
"HTTP 404 Page Not Found" page. It succeeds in creating the new site, and the new site shows up in my navigation bar,
but when I click on the new site, I get a "404 Page Not Found" page.

*********Details*************
On the original server, I created one top level site for my whole department. Under that, I have one subsite for each of our
external clients. Under each of those, I have one subsite for each project for that client. I used a Team site as my starting
point at each of the 3 leve

Categories: 
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