Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Asp objects

4,664 views

Published on

Published in: Technology
  • Be the first to comment

Asp objects

  1. 1. ASP OBJECTS
  2. 2. AN ASP OBJECT IS SOMETHING THAT TYPICALLY HAS  METHODS(determine the things one can do with objects)  PROPERTIES(attribute that describes the object)  COLLECTIONS(constitutes different sets of key value pairs)
  3. 3. WORKING OF ASP OBJECTS client request server Request object Response object Session object response Server object Asp error object Application object
  4. 4. REQUEST OBJECT:
  5. 5. BEFORE LEARNING ABOUT RESPONSE OBJECT LET’S UNDERSTAND THE GET & POST METHOD
  6. 6. These two methods are used to send data captured by various form elements
  7. 7. GET METHOD The browser submits the form data as the part of the url. The data captured is in the form elements is appended in the URL.
  8. 8. POST METHOD Send data captured by form elements back to the server as a separate bit stream
  9. 9. IF METHOD IS NOT SPECIFIED IN YOUR FORM THEN BY DEFAULT METHOD USED BY THE BROWSER IS A GET METHOD
  10. 10. REQUEST OBJECT: Collection: 1.The form collection 2.Query String(important)
  11. 11. FORM COLLECTION:  Syntax: Request.form(element)[(index)|.count) Name of the form element Used for selecting one of the Multiple values. Eg.radiobutton Elements or listbox elements IT RETRIVES THE VALUES OF THE FORM ELEMENTS POSTED TO HTTP REQUEST BODY,WITH A FORM USING POST METHOD
  12. 12. <body> <form action="nextpage.asp" method="post"> <p>ENTER YOUR NAME:<input name="USERNAME" size="20" type="text"></p> <p>CHOOSE YOUR CITY:<select name="CITY"> <option>DELHI</option> <option>BANGALORE</option> <option>KOLKATTA</option> </select> <input type="submit"></p> </form> </body> Elements TextBox & Dropdown list that contain values
  13. 13.  WHEN SUBMIT BUTTON IS CLICKED THE FORM IS POSTED TO ASP PAGE nextpage.asp  The following form data is sent back to server(Remember post method)  USERNAME=Anamika&CITY=DELHI  These are the values which are entered in the text box and selected from the dropdown list
  14. 14. NOW TO SHOW THESE VALUES IN THE NEXT PAGE WE USE:  <body> Welcome <%=Request.Form(“USERNAME”)%> City Selected<%=Request.Form(“CITY”)%> </body> These are just the values captured from the form elements of previous page USERNAME=Anamika&CITY=DELHI

×