I need the ddl to go back to Index= 0. I have tried various flavors of ddlMyddl.SelectedIndex.Value = 0 without success.
How should it be coded and where do I place the code?
T.Y.
MsLadyGeeYou could try
ddlMyddl.SelectedIndex = 0;if the index of the default item is 0. or
ddlMyddl.SelectedValue = "VALUE";where "VALUE" is the value of the default item.
hope this helps,
sivilian
This should be what you're after:
ddlMyDropDownList.ClearSelection()
AJN
The following did not work.
1) ddlMyddl.SelectedIndex = 0;
2) ddlMyddl.SelectedValue = "VALUE";
What has finally worked for me was to place a link back to the previous page and now the ddllistbox reflects the default index of "0".
Now I need to disable the back button.
ddlMyDropDownList.ClearSelection()--did not work for me.
What has finally worked for me was to place a link back to the previous page and now the ddllistbox reflects the default index of "0".
Now I need to disable the back button.
T.Y.
MsLadyGee
That's the browser trying to be smart (and you probably appreciate that after filling a long form, you can click back and find everything you typed still there).
So to get the initial state of the page instead, you'll need to write a little bit of javascript.
For example:
<body onload="myDropDownListID.selectedIndex=0">
0 comments:
Post a Comment