Geeks With Blogs

News

2004-2009
Celebrate Computer Science Education
Locations of visitors to this page
Brian Scarbeau Insights from a seasoned Computer Science Trainer

Today in class we reviewed the test that the students took yesterday. In addition, we talked about important concepts that students will be using in lesson 6. Students like to do the hands on part of my course and often times neglect to study new terms and concepts in computer science. Needless to say those are the students who scored below average and will need to buckle down and study harder for the next test next week.

Lesson 6 reviews the following concepts:

State, Postback, IsPostback, databinding and list controls.

What I like about the curriculum is that it covers the concept without going over the head of a high school students. Plus, it continues building a file which the student created in the last lesson.

Here's an example of what they are learning:

IsPostback

One of the neat things about ASP.NET is that it knows when a page has been requested for the first time and when the page has been subsequently requested (refreshed) as the result of a postback. The IsPostback property is a property of the ASPX page. It is set to False if the page is being requested for the first time and True if the page is requested as a result of a postback. IsPostback is a handy way of changing the content of your page depending on whether a postback has occurred. For example, if the page is being displayed for the first time, a welcome greeting is displayed. When the page is requested as a result of a postback, the welcome greeting is not displayed. IsPostback is often used to initialize variables and web control properties. When the page is first requested the variables are initialized and the control properties are set. On subsequent postbacks this information is saved in a snapshot of the page and does not have to be processed again. IsPostback saves server resources and makes your application faster.

The code is easy to follow:

if not ispostback then
    'these things happen when the page is first loaded
    label1.visible=true
else
    'these things happen when the page is posted back
    label1.visible=false
end if

Important concepts to learn in active server pages.

Posted on Wednesday, November 2, 2005 11:49 AM Teaching with ASP.NET | Back to top

Copyright © Brian Scarbeau | Powered by: GeeksWithBlogs.net