Page 118 - DCAP312_WEB_TECHNOLOGIES_II
P. 118

Web Technologies-II



                   Notes                   if (ddlquotes.SelectedIndex != -1)
                                           {
                                           lblquotes.Text = String.Format( “{0}, Quote: {1}”,
                                           ddlquotes.SelectedItem.Text, ddlquotes.SelectedValue);
                                           }
                                           }
                                           }
                                 Tracing
                                 To enable page level tracing, you need to modify the Page directive and add a Trace attribute as:
                                           <%@ Page Language= “C#” AutoEventWireup= “true”
                                           CodeBehind= “Default.aspx.cs”
                                           Inherits= “errorhandling._Default”
                                 Trace = “true” %>Now when you run the file, you get the tracing information:

                                 It provides the following information at the top:
                                    •  Session ID
                                    •  Status Code

                                    •  Time of Request
                                    •  Type of Request
                                    •  Request and Response Encoding
                                 The status code sent from the server, each time the page is requested shows the name and time
                                 of error if any. The following table shows the common HTTP status codes:(See Table 6.1)


                                                       Table 6.1: Common HTTP Status Codes
                                                      Number                   Description
                                               Informational (100 - 199)
                                               100                     Continue
                                               101                     Switching protocols
                                               Successful (200 - 299)
                                               200                     OK
                                               204                     No content
                                               Redirection (300 - 399)
                                               301                     Moved permanently
                                               305                     Use proxy
                                               307                     Temporary redirect
                                               Client Errors (400 - 499)
                                               400                     Bad request
                                               402                     Payment required
                                               404                     Not found
                                               408                     Request timeout
                                               417                     Expectation failed
                                               Server Errors (500 - 599)
                                               500                     Internal server error
                                               503                     Service unavailable
                                               505                     HTTP version not supported


        112                               LOVELY PROFESSIONAL UNIVERSITY
   113   114   115   116   117   118   119   120   121   122   123