dropdownlist problem in c#.. [Resolved]

Posted by Gopal_nivas under ASP.NET on 9/22/2010 | Points: 10 | Views : 1162 | Status : [Member] | Replies : 1
hi..

i was binding country values to drpdownlist..

here i want to show the text "usa" in first duing page load..

but the "usa" is in any position.. but i want to show tat in first as selected.

how to do this..

need ur suggestions
regards
gopal.s




Responses

Posted by: Laghaterohan on: 9/22/2010 [Member] Starter | Points: 50

Up
0
Down

Resolved
Gopal Is there any specific reason for this ?
In my opinion u can do this way :
dropdownlistname.insert.items(0, new listitem("usa","0"));

OR ELSE

on the pageload you write code like
dropdownlistname.selecteditem = "usa"

If your problem is not yet solved just revert .

Thanks!

Rohan Laghate

Best Regards,
Rohan Laghate

Gopal_nivas, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response