Authentic voices. Remarkable stories. AOL On Originals showcase the passions that make the world a more interesting place.
Hank Azaria’s touching, humorous, and often enlightening journey from a man who is not even sure he wants to have kids, to a father going through the joys, trials and tribulations of being a dad.
Gwyneth Paltrow and Tracy Anderson spend time with women who've overcome hardship, injury, and setbacks to triumph in the face of adversity.
Enter the graceful but competitive world of ballet through the eyes of executive producer, Sarah Jessica Parker. This behind-the-scenes docudrama reveals what it takes to perform on the ultimate stage, the New York City Ballet. Catch NYCB on stage at Lincoln Center.
ACTING DISRUPTIVE takes viewers inside the businesses and passion projects of Hollywood’s top celebrities.
Explore what it means to be human as we rush head first into the future through the eyes, creativity, and mind of Tiffany Shlain, acclaimed filmmaker and speaker, founder of The Webby Awards, mother, constant pusher of boundaries and one of Newsweek’s “women shaping the 21st Century.”
They say every picture tells a story and AOL On's new original series My Ink proves it. Travel along as some of the world's greatest athletes bring their tattoos to life through exclusive interviews and visits to their favorite tattoo parlors.
Discover crowdfunded small business success stories with author, comedian, and entrepreneur Baratunde Thurston.
Go behind-the-scenes with racing's hottest, young talent, 17-year-old Dylan Kwasniewski, as he aspires to make it in the #1 motorsport in America – NASCAR
Follow Scott Schuman, the Sartorialist, from the streets of NYC to the capitals of Europe on his quest to photograph and document the best in culture and fashion.
Iconic potter, designer, author and personality Jonathan Adler shares his unique perspective on creativity. Showcasing the inspiration Jonathan finds in the most unlikely people and places, Inspiration Point will add style, craft and joy to your life.
Serving Innovation gives a fresh look into the stories and passions that motivate some of the most innovative tastemakers in America.
A documentary directed by Alex Winter exploring the Napster downloading revolution; the kids who created it, the bands and businesses that were affected and its impact on the world at large.
Nicole Richie brings her unfiltered sense of humor and unique perspective to life in a new series based on her irreverent twitter feed. The show follows the outspoken celebrity as she shares her perspective on style, parenting, relationships and her journey to adulthood.
Learn how to perform initialization of list box programmatic.
Tags:asp list box control,asp.net,microsoft visual c#,microsoft windows,total training,visual studio 2005,web development
Grab video code:
Now, I am actually going to delete those items there. Let’s delete that. So, we will just have the list box load any items. And what we will see now is how to perform programmatic initialization. Imagine for example the scenario where the countries that we want to add to all this box is not known at development time, maybe it is going to change every time you run the application. Maybe we need to get the list of countries from the data base or maybe we need to call a web service to get the data from some dynamic place. So, rather than having fixed initialization, we file, default.aspx.cs. And if I just double click on that. That is the whole purpose for the Page Load Method. The Page Load Method gives us an opportunity and the place where we can perform programmatic initialization of the controls that make up our web page. Okay. So, for example, I can make code like this. CountryList.items.add and I can add an item to a list box programmatically. So, let us add Australia. Okay. And I am just going to copy that line of text to the clipboard and I am just going to paste it back then again a few times, paste, paste and paste. So, I am going to add various items to the list box, so let me see. Let us add Canada and let us also add France and we will also add Germany, there we go. So, just some countries selected at random. Okay. Well, let us try running the application and see what happens so, Control-F5 to run the application. Okay. Well, we’ve certainly have some work to do on the layout but then it is looking good. It has a label that displays some static initialization and there is the text box where I am going to enter my name so, Andy. And I can choose some items from here. Okay. That is very good. Just close on that. Now, that is fine. The only problem is that every time we post back to the web server, this code is going to be re-executed which means for example, the next time you post it back, Australia, Canada, France and Germany will be added again and then the next time you post back, they will be added again. It will be an accumulated effect which will obviously not what we want to achieve. Really, we only want to perform this initialization the very first time the pages loaded and not on a subsequent post back. And now, because it is such a common requirement, the page class has a static or shared property called IsPostBack. And that helps you to differentiate between whether this was the first time the pages has been requested or whether it is a subsequent post back. So, I need to add a statement like this. If it is not post back then I will just indent these statements and close off with the close coded bracket. So, a page load method will be invoke every time the page is requested but this initialization code will only be executed if the value for this time it will not be executed on each subsequent post back.