Skip to main content

Posts

Showing posts from July, 2010

70-562 Cookies

COOKIES SUMMARY http cookies are hidden message that travel between the webservers and their client, they are created on the server, and sent to the client. When client makes subsequent request to the web site, the cookie is embeded in the http header of that request. By default cookies remain in the browser memory and expires when the browser closes. By setting the Expires property of the cookie, you can control how long it will be kept, and save to disk on the client. Until the cookie expires, the browser automatically sends it with any request to the site where it originated from. Cookies were created in the last milenium for netscape explorer, specificaly to remember a shopping cart, between requests. COOKIES LOCATION ON THE SYSTEM The cookies for internet explorer are kept in the hidden appdata folder, and hidden Cookies folder and/or file of the logged in user, IE in windows 6 or later this is AppData\Roaming\Microsoft\Windows\Cookies, other browsers store in different locat

70-562 Preserving State

Notes to self... PRESERVING STATE The http protocol is stateless. You can preserve state at the 1)page level, 2)session level, 3)application level. Typically a user will request, submit, and resubmit pages, and each time it's state changes. User today expect that any data they enter on the form will persist accross those requests. If you type in a textbox and submit, the textbox will be empty when the page will return, unless the data is presreved. In classic asp, data had to be preserved manualy for each control in a request and response object, .net simplifies that by automatically preserving the state of all input controls on the form. DYNAMIC PAGE MODIFICATION MADE POSSIBLE BY THE ADDITION OF THE VIEWSTATE CONTROL It also  preserves information about different states of information that the page was in when it was sent to the browser(orignal state).. Therefore the hidden VIEWSTATE control contains an encoded representation of all non-default proprety setting. View

70-562 GridView Part 2

ADDING A HYPERLINK TO EACH ITEM OF A GIVEN COLUMN, HYPERLINK SENDING US TO A PAGE WITH MORE DETAILS Create a new target page that will provide extra details when the user clicks the hyperlink in the original gridview. First thing to do is to add a DataSource with a defautl WHERE clause that takes a value from the query string. It will come from REquest.QueryString("YourColumnName"); Now test that query in the designer before closing it. Add a hyperlink to the orignal gridview. You can add a new column, select the grid, go to it's smart tag and click add new column. Choose teh type from the ddl, choose the header text, for hyperlink text select the field you want displayed. Typicaly you don't need to comfigure the HyperLink text other than the where it gets it's data(no formating). The formating you need to configure is the one in the panel below (Hyperlink URL) because you're going to be passing this in the query string to be used to fill the grid of the targ

70-562 GridView Part 1

I will be adding code samples for these, this is notes I'm taking for the 70-762 exam, GridView chapter part 1. GRIDVIEW OVERVIEW The GridView replaces the 2.0 DataGrid, datagrid had too much configuration for sorting, grouping etc, that is now streamlined. You can drag a table from the server explorer on to a page and it will add a gridview and sqldatasource automatically, or you cando the same thing by selecting just the fields you need. Cick the gridview smartag to see gridview tasks like formating, but the autoformats are horrible. It can all be styled with some patience but thats another topic. Creating a basic GirdView can be done entirely by drag n drop, followed by drag and drop a datasource, enable typical operations(sorting, select, edit) from the smarttag of the grid, in design mode Typically those two objects form a two-tier application(presentation+data access layer). For n-tier, a middle layer(data repository) is added mapping datatables to objects, t