I have an array of numbers 3,6,10,15 and they print just fine in a loop but when I try to set the multiselect items they match, I get a "Object reference instance of an object." error.
html output:
<select size="4" name="jobtypes" multiple="multiple" id="jobtypes">
<option value="1">Teacher</option>
<option value="2">Nurse</option>
<option value="3">Fireman</option>
<option value="4">Waitress</option>
...
</select>
codebehind:
foreach (string s in jobtitles)
{
jobtitles.Items.FindByValue(s).Selected = true;
}
Any input would be greatly appreciated!!!
html output:
<select size="4" name="jobtypes" multiple="multiple" id="jobtypes">
<option value="1">Teacher</option>
<option value="2">Nurse</option>
<option value="3">Fireman</option>
<option value="4">Waitress</option>
...
</select>
codebehind:
foreach (string s in jobtitles)
{
jobtitles.Items.FindByValue(s).Selected = true;
}
Any input would be greatly appreciated!!!