Geeks With Blogs
Brian Scarbeau Insights from a seasoned Computer Science Trainer

It's very important as a teacher to make sure students follow written instructions when working with the Curlique lessons . Walk around the room and make sure students are working on their own vs having another student do everything for them.

Even after lecturing to students about concepts and even after giving a demo of what they will be doing in class there will always be that student that doesn't get it.  So what do you do?

The first thing that I do as a teacher is to have the student do the lesson over after I explain the concepts to them again. More than likely, the student missed doing something in the lesson and it was minor. However, if students don't understand the concepts then they will do poorly on the test that you give them.

Here's an example of the lesson in viewstate:


When a postback occurs, the browser sends a new request to the server. As part of this request, the ViewState is also sent. The ViewState contains information about the state of the page when the postback occurred. It's a snapshot of the page and gives, for example, the text in textboxes, which dropdownlist item was selected, and which checkboxes were checked. The ViewState information is encrypted for security reasons and then decoded by the server. The ViewState information is used by the server to construct its response.

All web controls have an EnableViewState property that can be set to True or False. By default, this property is set to True, which means the state of the control is saved in the ViewState. There are times when you want to set the EnableViewState property to False. For example, if a textbox control has its ReadOnly property set to True, you know its value won't change. There is no reason to save its ViewState property. Setting the ViewState property of your web controls to False increases the speed and performance of your web application.

All web controls also have a property called EnableViewStateMac (Mac stands for machine authentication check). You should leave the EnableViewStateMac property set to False.

Another useful feature of ViewState is that you can use it to store information between postbacks. You can save information in ViewState variables and then retrieve it again. The information is only saved in the ViewState of the current page; if you navigate to a different page, the ViewState data is lost. Reading from and writing to ViewState variables is easy:

dim outName as string
'save viewstate variable
ViewState("name")="Bobby Riggs"
'retrieve viewstate variable

ViewState variables are saved as strings. You may need to convert your value to a string before you save it to the ViewState.
I enjoy the Tech Tips that are included in the lesson.
The lesson usually has about 13 screens that students read on their own and follow instructions. Then there is a task that they do on their own.
Several students do finish early and will either help other students or start a new lesson.
Lesson 7 has the students create a photo album page using an array and a loop.


Posted on Friday, November 4, 2005 7:57 AM Teaching with ASP.NET | Back to top

Copyright © Brian Scarbeau | Powered by: