About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 35 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

The inconvenience of office moves brought me to a realization. When you're young, you want to have as much stuff as possible. "The kid who dies with the most toys wins." As you grow older, you realize that material goods are a burden and you try to get rid of them in order to simplify your life.

Raymond Chen



Navigation





<February 2025>
SMTWTFS
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 9/4/2024

Totals
Posts - 2655
Comments - 2677
Hits - 2,726,436

Averages
Entries/day - 0.34
Comments/entry - 1.01
Hits/day - 345

Updated every 30 minutes. Last: 10:11 AM Pacific


  09:33 PM

I'm just recording this for now, possibly for later investigation. In ASP.NET Web Pages 2 (Razor), you can take advantage of conditional attributes to set or clear attributes like selected and checked. These attributes don't need a value, they just need to exist, like this:

<select>
<option value="1">One</option>
<option value="2" selected >Two</option>
<option value="3">Three</option>
</select>
So how do you "remember" a list selection after a form submit? Here's one way. This seems a bit kludgy, but I can't offhand think of a way to do this without using JavaScript or something.

< select name="NumberList">
<option
selected=@(Request.Form["NumberList"] == "1")
value="1">One</option>
<option
selected=@(Request.Form["NumberList"] == "2")
value="2">Two</option>
<option
selected=@(Request.Form["NumberList"] == "3")
value="3">Three</option>
</select>

[categories]   ,

|