switch (DropDownList1.SelectedValue)
{
case "Image 1":
imgFoo.ImageUrl = "images/photo1.jpg";
break;
case "Image 2":
imgFoo.ImageUrl = "images/photo2.jpg";
break;
case "Image 3":
imgFoo.ImageUrl = "images/photo3.jpg";
break;
default:
imgFoo.ImageUrl = "images/photo_blank.jpg";
break;
}
Programming Journal C#, Java, SQL and to a lesser extent HTML, CSS, XML, and regex. I made this so other programmers could benefit from my experience.
Friday, September 14, 2007
C# switch statement for DropDownList to update Image url.
Simple control-flow statement to reference C# switch statement, which is similar to other language's case statement.
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(41)
-
▼
September
(13)
- Connecting to Kensoft.net SQL Server 2005 database
- Copying a MDF SQLExpress Database file to SQL Serv...
- Building an AJAX Slide Show in ASP.net
- Proper ViewState use and the coalescing operator
- GridView table headers and iterating over a GridVi...
- DataGridView cell contents and header contents
- HTML Table header accessibility standards
- C# switch statement for DropDownList to update Ima...
- Using XPath for reading attribute and content of XML
- Nested GridView with subtotals, totals, and counts
- Modifying the contents of a GridView after DataBin...
- Highlight search text functions using css tags and...
- C# to run stored procedure after parsing text
-
▼
September
(13)
1 comment:
Nice post and this fill someone in on helped me alot in my college assignement. Thank you as your information.
Post a Comment