Authentic voices. Remarkable stories. AOL On Originals showcase the passions that make the world a more interesting place.
The story of punk rock singer Laura Jane Grace of Against Me! who came out as a woman in 2012, and other members of the trans community whose experiences are woefully underrepresented and misunderstood in the media.
Documentary shorts conceived of and directed by famous actors. Jeff Garlin, Katie Holmes, Alia Shawkat, Judy Greer, and James Purefoy
Park Bench is a new kind of "talking show" straight from the mind of born and bred New Yorker and host, Steve Buscemi.
Digital influencer Justine Ezarik (iJustine) is back. After covering the world of wearable tech last season, iJustine is expanding her coverage this year by profiling the hottest tech trends across the country.
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.
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.
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.”
Gwyneth Paltrow and Tracy Anderson spend time with women who've overcome hardship, injury, and setbacks to triumph in the face of adversity.
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.
ACTING DISRUPTIVE takes viewers inside the businesses and passion projects of Hollywood’s top celebrities.
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.
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
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.