Page 43 - DCAP312_WEB_TECHNOLOGIES_II
P. 43

Unit 2: Introduction to C#



            HttpRequest Properties                                                                Notes
               •  ApplicationPath and PhysicalPath: ApplicationPath gets the ASP.NET application’s virtual
                 application  root  path  on  server  while  PhysicalPath  gets  the  Physical  file  system  path
                 corresponding to the requested URL.

               •  AnonymousID: This uniquely identifies the current user if we have enabled anonymous
                 access.

               •  Browser: This provides a link to the requesting client’s browser capabilities object.
               •  ClientCertificate:  This is an HttpClientCertificate object that gets the security certificate for
                 the current request.
               •  Cookies: This gets the collection cookies sent with this request.
               •  FilePath and CurrentExecutionFilePath: These return the virtual path of the current request.
               •  Form: This represents the collection of form variables that were posted back to the page. In
                 almost all cases we will retrieve the information from control properties instead of using
                 this collection.
               •  ServerVariables: This Returns a collection of named server variables sent with the request.
               •  IsAuthenticated: This returns true if the user has been successfully authenticated.
               •  IsSecureConnection: This indicates whether the HTTP connection uses secure sockets (that
                 is, HTTPS).
               •  Islocal: This returns true if the user is requesting the page from the current system.

               •  QueryString: This provides the parameters that are passed along with the query string.
               •  URLReferrer: This provides a Url object that represents the current address for the page
                 where the user is coming from.
               •  UserAgent: This is a string representing the browser type.
               •  UserHostAddress and UserHostName: These get the IP address and the DNS name of the
                 remote client.
               •  UserLanguages: This provides a stored string array of client’s language preference. This
                 can be useful if we need to create multilingual pages.
            Response

            The Response object is an example of the System.Web.HttpResponse class, and it represents the
            web server’s response to a client request.
            httpResponse Members

               •  Buffer Output: When set to true (the default), the page is not sent to the client until the
                 entire page is finished processing.

               •  Cache: It allows us to configure output caching of a Web page.
               •  Cookies: This is the collection of cookies sent with the response.
               •  Expires and Expires Absolute: We can use these properties to cache the rendered HTML for
                 the page for a specified period of time, which helps to improve performance for subsequent
                 requests.







                                             LOVELY PROFESSIONAL UNIVERSITY                                    37
   38   39   40   41   42   43   44   45   46   47   48