Recently I had an issue where I just could not set a drop down list’s selected value from the code behind. I set other drop down list’s selected values from the code behind with no problem. Just this one was giving me grief. So here is how I set the values normally (the drop down lists are inside a formview): VB.Net Dim ddl As DropDownList ddl = fvTest.FindControl("ddlWorks") ddl.SelectedValue = 5 C# DropDownList ddl; ddl = (DropDownList)fvTest.FindCo... int j = 5; ddl.SelectedValue ......
Here is another way to access master page controls. This way has a bit less coding then my previous post on the subject. The scenario would be that you have a master page with a few navigation buttons at the top for users to navigate the app. After a button is clicked the corresponding aspx page would load in the ContentPlaceHolder. To make it easier for the users to see what page they are on I wanted the clicked navigation button to change color. This would be a quick visual for the user and is ......